|
||||||||||
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.UnionConsistentHash
public class UnionConsistentHash
A delegating wrapper that locates keys by getting a union of locations reported by two other ConsistentHash implementations it delegates to.
Nested Class Summary | |
---|---|
static class |
UnionConsistentHash.Externalizer
|
Constructor Summary | |
---|---|
UnionConsistentHash(ConsistentHash oldCH,
ConsistentHash newCH)
|
Method Summary | |
---|---|
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. |
ConsistentHash |
getNewConsistentHash()
|
ConsistentHash |
getOldConsistentHash()
|
boolean |
isAdjacent(Address a1,
Address a2)
Tests whether two addresses are logically next to each other in the hash space. |
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. |
Methods inherited from class org.infinispan.distribution.AbstractConsistentHash |
---|
isKeyLocalToAddress, locateAll |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UnionConsistentHash(ConsistentHash oldCH, ConsistentHash newCH)
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 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 ConsistentHash getNewConsistentHash()
public ConsistentHash getOldConsistentHash()
|
Google Analytics | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |