Interface ConsistentHash
- All Known Implementing Classes:
ConsistentHashV2,CRC16ConsistentHashV2,SegmentConsistentHash
public interface ConsistentHash
Abstraction for the used consistent hash.
- Since:
- 14.0
-
Field Summary
Fields -
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.default Map<SocketAddress, Set<Integer>> voidinit(Map<SocketAddress, Set<Integer>> servers2Hash, int numKeyOwners, int hashSpace) Deprecated.
-
Field Details
-
DEFAULT
-
-
Method Details
-
init
@Deprecated void init(Map<SocketAddress, Set<Integer>> servers2Hash, int numKeyOwners, int hashSpace) Deprecated. -
getServer
-
getNormalizedHash
Computes hash code of a given object, and then normalizes it to ensure a positive value is always returned.- Parameters:
object- to hash- Returns:
- a non-null, non-negative normalized hash code for a given object
-
getSegmentsByServer
Map<SocketAddress,Set<Integer>> getSegmentsByServer() -
getPrimarySegmentsByServer
-