Class ConsistentHash<T>
A consistant hash implementation with murmur hash.
Inheritance
ConsistentHash<T>
Assembly: Advanced.Algorithms.dll
Syntax
public class ConsistentHash<T> : object
Type Parameters
Constructors
ConsistentHash()
Declaration
ConsistentHash(IEnumerable<T>, Int32)
Declaration
public ConsistentHash(IEnumerable<T> nodes, int replicas)
Parameters
Type |
Name |
Description |
IEnumerable<T> |
nodes |
|
Int32 |
replicas |
|
Methods
AddNode(T)
Declaration
public void AddNode(T node)
Parameters
Type |
Name |
Description |
T |
node |
|
GetNode(String)
Get the bucket for the given Key.
Declaration
public T GetNode(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
RemoveNode(T)
Remove a bucket from lookup.
Declaration
public void RemoveNode(T node)
Parameters
Type |
Name |
Description |
T |
node |
|