|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.distribution.AbstractConsistentHash
org.infinispan.distribution.DefaultConsistentHash
public class DefaultConsistentHash
Nested Class Summary | |
---|---|
static class |
DefaultConsistentHash.Externalizer
|
Constructor Summary | |
---|---|
DefaultConsistentHash()
|
Method Summary | |
---|---|
boolean |
equals(Object o)
|
List<Address> |
getCaches()
Should return a collection of cache addresses in the cluster. |
int |
getDistance(Address a1,
Address a2)
Calculates the logical distance between two addresses. |
int |
hashCode()
|
boolean |
isAdjacent(Address a1,
Address a2)
Tests whether two addresses are logically next to each other in the hash space. |
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). |
void |
setCaches(List<Address> caches)
Sets the collection of cache addresses in the cluster. |
String |
toString()
|
Methods inherited from class org.infinispan.distribution.AbstractConsistentHash |
---|
locateAll |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultConsistentHash()
Method Detail |
---|
public void setCaches(List<Address> caches)
ConsistentHash
caches
- caches in cluster.public List<Address> getCaches()
ConsistentHash
public List<Address> locate(Object key, int replCount)
ConsistentHash
key
- key to locatereplCount
- replication count (number of copies)
ConsistentHash.setCaches(java.util.List)
. 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 count
public int getDistance(Address a1, Address a2)
ConsistentHash
a1
- address to testa2
- address to test
public boolean isAdjacent(Address a1, Address a2)
ConsistentHash
a1
- address to testa2
- address to test
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |