See Release Notes
Long Term Support Release
(no description)
File Size: | 244 lines (7 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
Horde_Support_ConsistentHash:: (8 methods):
__construct()
get()
getNodes()
add()
addNodes()
remove()
hash()
_updateCircle()
Class: Horde_Support_ConsistentHash - X-Ref
For a thorough description of consistent hashing, see__construct($nodes = array() X-Ref |
Create a new consistent hash, with initial $nodes at $numberOfReplicas param: array $nodes Initial array of nodes to add at $weight. param: integer $weight The weight for the initial node list. param: integer $numberOfReplicas The number of points on the circle to generate for each node. |
get($key) X-Ref |
Get the primary node for $key. param: string $key The key to look up. param: string The primary node for $key. |
getNodes($key, $count = 5) X-Ref |
Get an ordered list of nodes for $key. param: string $key The key to look up. param: integer $count The number of nodes to look up. return: array An ordered array of nodes. |
add($node, $weight = 1) X-Ref |
Add $node with weight $weight param: mixed $node |
addNodes($nodes, $weight = 1) X-Ref |
Add multiple nodes to the hash with the same weight. param: array $nodes An array of nodes. param: integer $weight The weight to add the nodes with. |
remove($node) X-Ref |
Remove $node from the hash. param: mixed $node |
hash($key) X-Ref |
Expose the hash function for testing, probing, and extension. param: string $key return: string Hash value |
_updateCircle() X-Ref |
Maintain the circle and arrays of points. |