|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.distribution.ch.AbstractConsistentHash
org.infinispan.distribution.ch.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
|
Field Summary |
---|
Fields inherited from class org.infinispan.distribution.ch.AbstractConsistentHash |
---|
caches |
Constructor Summary | |
---|---|
UnionConsistentHash(ConsistentHash oldCH,
ConsistentHash newCH)
|
Method Summary | |
---|---|
List<Address> |
getBackupsForNode(Address node,
int replCount)
Returns the nodes that backup data for the supplied node including the node itself. |
Set<Address> |
getCaches()
Should return a collection of cache addresses in the cluster. |
int |
getHashId(Address a)
Returns the value between 0 and the hash space limit, or hash id, for a particular address. |
int |
getHashSpace()
Returns the hash space constant for this consistent hash algorithm class. |
ConsistentHash |
getNewConsistentHash()
|
ConsistentHash |
getOldConsistentHash()
|
List<Address> |
getStateProvidersOnJoin(Address joiner,
int replCount)
Returns the nodes that would act as state providers when a new node joins: - the nodes for which the joiner is a backup - the nodes that held joiner's state |
List<Address> |
getStateProvidersOnLeave(Address leaver,
int replCount)
Returns the nodes that need will replicate their state if the specified node crashes. |
List<Address> |
locate(Object key,
int replCount)
Locates a key, given a replication count (number of copies). |
void |
setCaches(Set<Address> caches)
Sets the collection of cache addresses in the cluster. |
Methods inherited from class org.infinispan.distribution.ch.AbstractConsistentHash |
---|
isKeyLocalToAddress, locateAll, setTopologyInfo, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UnionConsistentHash(ConsistentHash oldCH, ConsistentHash newCH)
Method Detail |
---|
public void setCaches(Set<Address> caches)
ConsistentHash
setCaches
in interface ConsistentHash
setCaches
in class AbstractConsistentHash
caches
- A set of unique caches in cluster.public Set<Address> getCaches()
ConsistentHash
getCaches
in interface ConsistentHash
getCaches
in class AbstractConsistentHash
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 int getHashId(Address a)
ConsistentHash
public List<Address> getStateProvidersOnLeave(Address leaver, int replCount)
ConsistentHash
Pre: leaver must be present in the caches known to this CH, as returned by ConsistentHash.getCaches()
leaver
- the node that leaves the clusterpublic List<Address> getStateProvidersOnJoin(Address joiner, int replCount)
ConsistentHash
public List<Address> getBackupsForNode(Address node, int replCount)
ConsistentHash
public int getHashSpace()
ConsistentHash
public ConsistentHash getNewConsistentHash()
public ConsistentHash getOldConsistentHash()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |