Class ConsistentHashV2
java.lang.Object
org.infinispan.hotrod.impl.consistenthash.ConsistentHashV2
- All Implemented Interfaces:
ConsistentHash
- Direct Known Subclasses:
CRC16ConsistentHashV2
Version 2 of the ConsistentHash function. Uses MurmurHash3.
- Since:
- 14.0
- See Also:
-
Field Summary
FieldsFields inherited from interface org.infinispan.hotrod.impl.consistenthash.ConsistentHash
DEFAULT -
Constructor Summary
ConstructorsConstructorDescriptionConsistentHashV2(Random rnd) ConsistentHashV2(Random rnd, org.infinispan.commons.hash.Hash hash) -
Method Summary
Modifier and TypeMethodDescriptionfinal intgetNormalizedHash(Object object) Computes hash code of a given object, and then normalizes it to ensure a positive value is always returned.voidinit(Map<SocketAddress, Set<Integer>> servers2Hash, int numKeyOwners, int hashSpace)
-
Field Details
-
hash
protected final org.infinispan.commons.hash.Hash hash
-
-
Constructor Details
-
ConsistentHashV2
-
ConsistentHashV2
-
-
Method Details
-
init
- Specified by:
initin interfaceConsistentHash
-
getServer
- Specified by:
getServerin interfaceConsistentHash
-
getNormalizedHash
Description copied from interface:ConsistentHashComputes hash code of a given object, and then normalizes it to ensure a positive value is always returned.- Specified by:
getNormalizedHashin interfaceConsistentHash- Parameters:
object- to hash- Returns:
- a non-null, non-negative normalized hash code for a given object
-
getSegmentsByServer
- Specified by:
getSegmentsByServerin interfaceConsistentHash
-
getPrimarySegmentsByServer
- Specified by:
getPrimarySegmentsByServerin interfaceConsistentHash
-