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.
|
SocketAddress |
getServer(byte[] 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(byte[] key)
getServer in interface ConsistentHashpublic void setHash(Hash hash)
public final int getNormalizedHash(Object object)
ConsistentHashgetNormalizedHash in interface ConsistentHashobject - to hashCopyright © 2016 JBoss, a division of Red Hat. All rights reserved.