Property | Type | Description | |
---|---|---|---|
$_groupCount | integer | ||
$_hashRingGroups | - Groups corresponding to hash values in _hashRingIds | ||
$_hashRingIds | - Sorted list of hash values, for binary search. |
Method | Description | |
---|---|---|
__construct ( integer $groupCount ) | ||
generate_key_hash ( string $material ) : integer | Returns a 30-bit signed integer (i.e. in the range [0, self::MAX-1]) Designed to work on 32-bit php installations as well. | |
getGroup ( string $key ) : integer | Do a binary search in the consistent hashing ring to find the group. | |
get_hashes_for_group ( integer $group ) : array | ||
reset ( ) : void | No-op reset |
public static generate_key_hash ( string $material ) : integer | ||
$material | string | |
return | integer |
public static get_hashes_for_group ( integer $group ) : array | ||
$group | integer | |
return | array |
protected $_hashRingGroups |