lib/consistent_hashing/ring.rb in consistent-hashing-1.0.0 vs lib/consistent_hashing/ring.rb in consistent-hashing-2.0.0
- old
+ new
@@ -31,27 +31,23 @@
@ring[key] = VirtualPoint.new(node, key)
end
end
- # Public: adds a new node into the hash ring like `add` but returns
- # a reference to the ring to be used as a fluent interface
+ # Public: an alias for `add`
#
def <<(node)
add(node)
- self
end
# Public: removes a node from the hash ring
#
def delete(node)
@replicas.times do |i|
key = hash_key(node, i)
@ring.delete key
end
-
- self
end
# Public: gets the point for an arbitrary key
#
#