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, setGroupManagerpublic Set<Address> getCaches()
ConsistentHashpublic void setCaches(Set<Address> caches)
ConsistentHashcaches - 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)
ConsistentHashkey - 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)
ConsistentHashpublic String toString()
toString in class AbstractConsistentHashCopyright © 2012 JBoss by Red Hat. All Rights Reserved.