public class ConsistentHashV1 extends Object implements ConsistentHash
MurmurHash2;| Constructor and Description |
|---|
ConsistentHashV1() |
ConsistentHashV1(Random rnd) |
| Modifier and Type | Method and Description |
|---|---|
int |
getNormalizedHash(Object object)
Computes hash code of a given object, and then normalizes it to ensure a positive
value is always returned.
|
Map<SocketAddress,Set<Integer>> |
getSegmentsByServer() |
SocketAddress |
getServer(Object key) |
void |
init(Map<SocketAddress,Set<Integer>> servers2Hash,
int numKeyOwners,
int hashSpace) |
void |
setHash(Hash hash) |
protected Hash hash
public ConsistentHashV1(Random rnd)
public ConsistentHashV1()
public void init(Map<SocketAddress,Set<Integer>> servers2Hash, int numKeyOwners, int hashSpace)
init in interface ConsistentHashpublic SocketAddress getServer(Object key)
getServer in interface ConsistentHashpublic void setHash(Hash hash)
public final int getNormalizedHash(Object object)
ConsistentHashgetNormalizedHash in interface ConsistentHashobject - to hashpublic Map<SocketAddress,Set<Integer>> getSegmentsByServer()
getSegmentsByServer in interface ConsistentHashCopyright © 2024 JBoss, a division of Red Hat. All rights reserved.