Class SegmentConsistentHash
java.lang.Object
org.infinispan.hotrod.impl.consistenthash.SegmentConsistentHash
- All Implemented Interfaces:
ConsistentHash
-
Field Summary
Fields inherited from interface org.infinispan.hotrod.impl.consistenthash.ConsistentHash
DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetNormalizedHash(Object object) Computes hash code of a given object, and then normalizes it to ensure a positive value is always returned.intintgetSegment(Object key) SocketAddress[][]voidinit(SocketAddress[][] segmentOwners, int numSegments) voidinit(Map<SocketAddress, Set<Integer>> servers2Hash, int numKeyOwners, int hashSpace)
-
Constructor Details
-
SegmentConsistentHash
public SegmentConsistentHash()
-
-
Method Details
-
init
- Specified by:
initin interfaceConsistentHash
-
init
-
getServer
- Specified by:
getServerin interfaceConsistentHash
-
getSegment
-
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
-
getNumSegments
public int getNumSegments() -
getSegmentOwners
-