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