class

RingConsistentHasher(T)

Inherits Hasher < Reference < Object

Ring-based Consistent Hash implementation. Uses a hash ring with virtual nodes for consistent key-to-node mapping. Information on Consistent Hash Ring: http://www.martinbroadhurst.com/Consistent-Hash-Ring.html

Constructors

Instance methods

add(key : String, weight : UInt32, target : T)

Add a target to the hasher with the given key and weight. The weight determines how many "slots" or "virtual nodes" the target occupies.

Source
get(key : String) : T | Nil

Get the target for the given key, or nil if no targets exist.

Source
remove(key : String, weight : UInt32)

Remove a target from the hasher using its key and weight. The weight must match what was used when adding.

Source