consistent-hashing 1.0.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWE4MTk2NWU4MTcxMDMzMzA1NWU2MDlmZTc5NTdjMzQ2MTQ0NWYxYg==
5
- data.tar.gz: !binary |-
6
- MWU3ODg0ZTEyYjZiMTJjMjJjNmE4MzkwODA2MWZiZjFjMWVhYjE1Yg==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- MjNlZmQyNTZlMTVkNmQ3MDRjODY3ODQ4OWQzODg5YTA3MTQyYzg0YmE5YWEy
10
- ODc5MmMxZDg0ZmU3ZTVhZDg3ZWU5OWVkYjNiOGU1ZGM1NmYyN2MwZDE1OGUy
11
- MjE1ZjNlZjE1ZmE5YjkzNzZiNDgwNTM4ZGJhZGQ5YjAwNDlkMzM=
12
- data.tar.gz: !binary |-
13
- NmNhYjEyOGM3YjJkZDM2Yjk4ZmUyZDViNTdiODExZGNlNDg2YzljZTc5Mzc1
14
- MGVjNTEzMmRlYmE1MGE0OWE3YWE4NjBlODZhYTZiOGExMGRkMjBhZmIzNzBm
15
- NWI3NTZjNmIwYWRkY2IyMmU3OTI0NTlkOWM4NDBmMThjZWZiNWM=
2
+ SHA256:
3
+ metadata.gz: ee514f1097925a60e517bccefc7cda89e3c63419cd3df25ea851cddba89df503
4
+ data.tar.gz: 291f9b2bc7cb86b81cba2e9b8f30ed753bba3667c20e0c8fa6a1071fe1adc1d2
5
+ SHA512:
6
+ metadata.gz: 49259547ef78e9feeab8a1a466ffd8b8d3b15aa078f125359e6d3aa8b247f5c8999fead56eb87adb23ce24fdff71f346ac488ccaccd3a1c88110235db8f0cc22
7
+ data.tar.gz: a5dffa477fabe0030de8b713a933af6d56c2020df68f68f5200dffbc01e11774f7d04a38b757f7c45e8c109eccf151d214e0d3fa681a43506e9a4f45c933633a
@@ -1,6 +1,6 @@
1
- == 1.0.0 / 2013-12-06
1
+ == 2.0.0 / 2019-08-26
2
2
 
3
- * separated << and add methods for the ring, add no longer returns a self reference (potentionally critical on large rings)
3
+ * fixed probable performance issue with Ring.<< and Ring.delete which could occur using a large Ring
4
4
 
5
5
  == 0.2.1 / 2013-04-27
6
6
 
@@ -18,4 +18,4 @@
18
18
 
19
19
  == 0.0.1 / 2012-04-15
20
20
 
21
- * Birthday!
21
+ * Birthday!
data/README.md CHANGED
@@ -16,7 +16,8 @@ A generic implementation of the Consistent Hashing algorithm using an AVL tree.
16
16
  require 'consistent_hashing'
17
17
 
18
18
  ring = ConsistentHashing::Ring.new
19
- ring << "192.168.1.101" << "192.168.1.102"
19
+ ring << "192.168.1.101"
20
+ ring << "192.168.1.102"
20
21
 
21
22
  ring.node_for("foobar") # => 192.168.1.101
22
23
  ring.delete("192.168.1.101")
@@ -29,24 +30,19 @@ ring.nodes # => ["192.168.1.101", "192.168.1.102"]
29
30
  ring.points # => [#<ConsistentHashing::VirtualPoint>, #<ConsistentHashing::VirtualPoint>, ...]
30
31
  ```
31
32
 
32
- ## A note on large rings
33
-
34
- For large amounts of nodes, avoid using the `<<` method. Use `add` instead to add the nodes to the ring. The reason for
35
- this is, that each call to `<<` returns a reference to the complete ring, which can get quite big.
36
-
37
33
  ## Installation
38
34
 
39
35
  * `[sudo] gem install consistent-hashing`
40
36
 
41
37
  ## Author
42
38
 
43
- Original author: Dominik Liebler <liebler.dominik@googlemail.com>
39
+ Original author: Dominik Liebler <liebler.dominik@gmail.com>
44
40
 
45
41
  ## License
46
42
 
47
43
  (The MIT License)
48
44
 
49
- Copyright (c) 2013 Dominik Liebler
45
+ Copyright (c) 2013 - 2019 Dominik Liebler
50
46
 
51
47
  Permission is hereby granted, free of charge, to any person obtaining
52
48
  a copy of this software and associated documentation files (the
@@ -33,12 +33,10 @@ module ConsistentHashing
33
33
  end
34
34
  end
35
35
 
36
- # Public: adds a new node into the hash ring like `add` but returns
37
- # a reference to the ring to be used as a fluent interface
36
+ # Public: an alias for `add`
38
37
  #
39
38
  def <<(node)
40
39
  add(node)
41
- self
42
40
  end
43
41
 
44
42
  # Public: removes a node from the hash ring
@@ -49,8 +47,6 @@ module ConsistentHashing
49
47
 
50
48
  @ring.delete key
51
49
  end
52
-
53
- self
54
50
  end
55
51
 
56
52
  # Public: gets the point for an arbitrary key
@@ -21,7 +21,8 @@ class TestRing < ConsistentHashing::TestCase
21
21
  ring = ConsistentHashing::Ring.new([], 3)
22
22
  assert_equal 0, ring.length
23
23
 
24
- ring << "A" << "B"
24
+ ring << "A"
25
+ ring << "B"
25
26
  assert_equal 6, ring.length
26
27
  end
27
28
 
@@ -3,7 +3,7 @@ $:.unshift(File.join(File.dirname(__FILE__), %w{.. lib}))
3
3
  begin
4
4
  require 'simplecov'
5
5
  SimpleCov.start
6
- rescue LoadError => e
6
+ rescue LoadError
7
7
  # ignore
8
8
  end
9
9
 
@@ -1 +1 @@
1
- 1.0.0
1
+ 2.0.0
metadata CHANGED
@@ -1,76 +1,76 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: consistent-hashing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Liebler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-06 00:00:00.000000000 Z
11
+ date: 2019-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avl_tree
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 1.1.3
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.1.3
27
27
  description: a Consistent Hashing implementation in pure Ruby using an AVL Tree
28
- email: liebler.dominik@googlemail.com
28
+ email: liebler.dominik@gmail.com
29
29
  executables: []
30
30
  extensions: []
31
31
  extra_rdoc_files:
32
32
  - History.txt
33
33
  files:
34
+ - History.txt
35
+ - README.md
36
+ - Rakefile
37
+ - benchmark/benchmark.rb
38
+ - lib/consistent_hashing.rb
34
39
  - lib/consistent_hashing/avl_tree.rb
35
- - lib/consistent_hashing/virtual_point.rb
36
40
  - lib/consistent_hashing/ring.rb
37
- - lib/consistent_hashing.rb
38
- - test/consistent_hashing/test_virtual_point.rb
41
+ - lib/consistent_hashing/virtual_point.rb
39
42
  - test/consistent_hashing/test_avl_tree.rb
40
43
  - test/consistent_hashing/test_ring.rb
44
+ - test/consistent_hashing/test_virtual_point.rb
41
45
  - test/test_consistent_hashing.rb
42
- - benchmark/benchmark.rb
43
- - README.md
44
- - History.txt
45
- - Rakefile
46
46
  - version.txt
47
47
  homepage: https://github.com/domnikl/consistent-hashing
48
48
  licenses: []
49
49
  metadata: {}
50
50
  post_install_message:
51
51
  rdoc_options:
52
- - --main
52
+ - "--main"
53
53
  - README.md
54
54
  require_paths:
55
55
  - lib
56
56
  required_ruby_version: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ! '>='
58
+ - - ">="
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0'
61
61
  required_rubygems_version: !ruby/object:Gem::Requirement
62
62
  requirements:
63
- - - ! '>='
63
+ - - ">="
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
67
  rubyforge_project: consistent-hashing
68
- rubygems_version: 2.0.3
68
+ rubygems_version: 2.7.8
69
69
  signing_key:
70
70
  specification_version: 3
71
71
  summary: ''
72
72
  test_files:
73
- - test/consistent_hashing/test_virtual_point.rb
74
- - test/consistent_hashing/test_avl_tree.rb
75
73
  - test/consistent_hashing/test_ring.rb
74
+ - test/consistent_hashing/test_avl_tree.rb
75
+ - test/consistent_hashing/test_virtual_point.rb
76
76
  - test/test_consistent_hashing.rb