Class HashRingExtensions
Inheritance
System.Object
HashRingExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: ConsistentHashing
Assembly: ConsistentHashing.dll
Syntax
public static class HashRingExtensions
Methods
| Improve this Doc View SourceAddVirtualNodes<TNode>(IConsistentHashRing<TNode>, TNode, IEnumerable<UInt32>)
Adds a node to the hash ring many times as virtual nodes.
Declaration
public static void AddVirtualNodes<TNode>(this IConsistentHashRing<TNode> ring, TNode node, IEnumerable<uint> virtualNodes)
where TNode : IComparable<TNode>
Parameters
Type | Name | Description |
---|---|---|
IConsistentHashRing<TNode> | ring | The hash ring to add to. |
TNode | node | The node to add. |
System.Collections.Generic.IEnumerable<System.UInt32> | virtualNodes | The hash points to add the node to. |
Type Parameters
Name | Description |
---|---|
TNode | The node type. |
GetRangesForNode<TNode>(IConsistentHashRing<TNode>, TNode)
Gets all the ranges a node owns as a HashRangeCollection.
Declaration
public static HashRangeCollection GetRangesForNode<TNode>(this IConsistentHashRing<TNode> ring, TNode node)
where TNode : IComparable<TNode>
Parameters
Type | Name | Description |
---|---|---|
IConsistentHashRing<TNode> | ring | The hash ring to get from. |
TNode | node | The node to get ranges for. |
Returns
Type | Description |
---|---|
HashRangeCollection | A HashRangeCollection of all the ranges the specified node owns. |
Type Parameters
Name | Description |
---|---|
TNode | The node type. |