public class ExperimentalDefaultConsistentHash extends AbstractConsistentHash
Modifier and Type | Class and Description |
---|---|
static class |
ExperimentalDefaultConsistentHash.Entry
An entry into a consistent hash.
|
static class |
ExperimentalDefaultConsistentHash.Externalizer |
groupManager
Constructor and Description |
---|
ExperimentalDefaultConsistentHash() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
Set<Address> |
getCaches()
Should return a collection of cache addresses in the cluster.
|
int |
getDistance(Address a1,
Address a2)
The distance between the first entries in the address array for two caches, a1 and a2.
|
List<Integer> |
getHashIds(Address a)
Returns a list of values between 0 and the hash space limit, or hash id,
for a particular address.
|
int |
hashCode() |
boolean |
isAdjacent(Address a1,
Address a2)
Two hashes are adjacent if they are next to each other in the consistent hash.
|
List<Address> |
locate(Object key,
int replCount)
Locates a key, given a replication count (number of copies).
|
void |
setCaches(Collection<Address> caches) |
void |
setCaches(Set<Address> caches)
Sets the collection of cache addresses in the cluster.
|
String |
toString() |
getBackupsForNode, getGrouping, getStateProvidersOnJoin, getStateProvidersOnLeave, isKeyLocalToAddress, locateAll, primaryLocation, setGroupManager
public Set<Address> getCaches()
ConsistentHash
public void setCaches(Set<Address> caches)
ConsistentHash
caches
- A set of unique caches in cluster.public void setCaches(Collection<Address> caches)
public int getDistance(Address a1, Address a2)
a1
- The address of the first cache.a2
- The address of the second cache.public boolean isAdjacent(Address a1, Address a2)
a1
- The address of the first cache.a2
- The address of the second cache.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 List<Integer> getHashIds(Address a)
ConsistentHash
public String toString()
toString
in class AbstractConsistentHash
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.