public class DefaultConsistentHash extends AbstractWheelConsistentHash
Modifier and Type | Class and Description |
---|---|
static class |
DefaultConsistentHash.Externalizer |
caches, hashFunction, numVirtualNodes, positionKeys, positionValues, trace
groupManager
Constructor and Description |
---|
DefaultConsistentHash() |
DefaultConsistentHash(Hash hash) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
protected Log |
getLog() |
int |
hashCode() |
boolean |
isKeyLocalToAddress(Address target,
Object key,
int replCount)
Test to see whether a key is mapped to a given address.
|
List<Address> |
locate(Object key,
int replCount)
Locates a key, given a replication count (number of copies).
|
getCaches, getHashIds, getNormalizedHash, getPositionIndex, getPositionsIterator, isVirtualNodesEnabled, primaryLocation, setCaches, setHashFunction, setNumVirtualNodes, toString
getBackupsForNode, getGrouping, getStateProvidersOnJoin, getStateProvidersOnLeave, locateAll, setGroupManager
public DefaultConsistentHash()
public DefaultConsistentHash(Hash hash)
public List<Address> locate(Object key, int replCount)
ConsistentHash
key
- key to locatereplCount
- replication count (number of copies)ConsistentHash.setCaches(java.util.Set)
. Should never be null, and should contain replCount elements or the max
number of caches available, whichever is smaller.public boolean isKeyLocalToAddress(Address target, Object key, int replCount)
ConsistentHash
isKeyLocalToAddress
in interface ConsistentHash
isKeyLocalToAddress
in class AbstractConsistentHash
target
- address to testkey
- key to testreplCount
- repl countprotected Log getLog()
getLog
in class AbstractWheelConsistentHash
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.