Package org.infinispan.topology
Class CacheTopology
- java.lang.Object
-
- org.infinispan.topology.CacheTopology
-
- Direct Known Subclasses:
LocalizedCacheTopology
public class CacheTopology extends Object
The status of a cache from a distribution/state transfer point of view. The pending CH can benullif we don't have a state transfer in progress. ThetopologyIdis incremented every time the topology changes (e.g. a member leaves, state transfer starts or ends). TherebalanceIdis not modified when the consistent hashes are updated without requiring state transfer (e.g. when a member leaves).- Since:
- 5.2
- Author:
- Dan Berindei
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheTopology.Externalizerstatic classCacheTopology.PhasePhase of the rebalance process.
-
Constructor Summary
Constructors Constructor Description CacheTopology(int topologyId, int rebalanceId, ConsistentHash currentCH, ConsistentHash pendingCH, ConsistentHash unionCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs)CacheTopology(int topologyId, int rebalanceId, ConsistentHash currentCH, ConsistentHash pendingCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)List<Address>getActualMembers()ConsistentHashgetCurrentCH()The current consistent hash.List<Address>getMembers()List<PersistentUUID>getMembersPersistentUUIDs()ConsistentHashgetPendingCH()The future consistent hash.CacheTopology.PhasegetPhase()ConsistentHashgetReadConsistentHash()Read operations should always go to the "current" owners.intgetRebalanceId()The id of the latest started rebalance.intgetTopologyId()ConsistentHashgetUnionCH()The union of the current and future consistent hashes.ConsistentHashgetWriteConsistentHash()When there is a rebalance in progress, write operations should go to the union of the "current" and "future" owners.inthashCode()voidlogRoutingTableInformation()StringtoString()
-
-
-
Constructor Detail
-
CacheTopology
public CacheTopology(int topologyId, int rebalanceId, ConsistentHash currentCH, ConsistentHash pendingCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs)
-
CacheTopology
public CacheTopology(int topologyId, int rebalanceId, ConsistentHash currentCH, ConsistentHash pendingCH, ConsistentHash unionCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs)
-
-
Method Detail
-
getTopologyId
public int getTopologyId()
-
getCurrentCH
public ConsistentHash getCurrentCH()
The current consistent hash.
-
getPendingCH
public ConsistentHash getPendingCH()
The future consistent hash. Should benullif there is no rebalance in progress.
-
getUnionCH
public ConsistentHash getUnionCH()
The union of the current and future consistent hashes. Should benullif there is no rebalance in progress.
-
getRebalanceId
public int getRebalanceId()
The id of the latest started rebalance.
-
getMembers
public List<Address> getMembers()
- Returns:
- The nodes that are members in both consistent hashes (if
pendingCH != null, otherwise the members of the current CH). - See Also:
getActualMembers()
-
getActualMembers
public List<Address> getActualMembers()
- Returns:
- The nodes that are active members of the cache. It should be equal to
getMembers()when the cache is available, and a strict subset if the cache is in degraded mode. - See Also:
AvailabilityMode
-
getMembersPersistentUUIDs
public List<PersistentUUID> getMembersPersistentUUIDs()
-
getReadConsistentHash
public ConsistentHash getReadConsistentHash()
Read operations should always go to the "current" owners.
-
getWriteConsistentHash
public ConsistentHash getWriteConsistentHash()
When there is a rebalance in progress, write operations should go to the union of the "current" and "future" owners.
-
logRoutingTableInformation
public final void logRoutingTableInformation()
-
getPhase
public CacheTopology.Phase getPhase()
-
-