Package org.infinispan.topology
Class CacheTopology
java.lang.Object
org.infinispan.topology.CacheTopology
- Direct Known Subclasses:
LocalizedCacheTopology
The status of a cache from a distribution/state transfer point of view.
The pending CH can be
null
if we don't have a state transfer in progress.
The topologyId
is incremented every time the topology changes (e.g. a member leaves, state transfer
starts or ends).
The rebalanceId
is 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
Modifier and TypeClassDescriptionstatic class
static enum
Phase of the rebalance process. -
Constructor Summary
ConstructorDescriptionCacheTopology
(int topologyId, int rebalanceId, boolean restoredTopology, ConsistentHash currentCH, ConsistentHash pendingCH, ConsistentHash unionCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs) CacheTopology
(int topologyId, int rebalanceId, boolean restoredTopology, ConsistentHash currentCH, ConsistentHash pendingCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs) 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
Modifier and TypeMethodDescriptionboolean
The current consistent hash.The future consistent hash.getPhase()
Read operations should always go to the "current" owners.int
The id of the latest started rebalance.int
The union of the current and future consistent hashes.When there is a rebalance in progress, write operations should go to the union of the "current" and "future" owners.int
hashCode()
final void
logRoutingTableInformation
(String cacheName) toString()
boolean
-
Constructor Details
-
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, boolean restoredTopology, 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) -
CacheTopology
public CacheTopology(int topologyId, int rebalanceId, boolean restoredTopology, ConsistentHash currentCH, ConsistentHash pendingCH, ConsistentHash unionCH, CacheTopology.Phase phase, List<Address> actualMembers, List<PersistentUUID> persistentUUIDs)
-
-
Method Details
-
getTopologyId
public int getTopologyId() -
getCurrentCH
The current consistent hash. -
getPendingCH
The future consistent hash. Should benull
if there is no rebalance in progress. -
getUnionCH
The union of the current and future consistent hashes. Should benull
if there is no rebalance in progress. -
getRebalanceId
public int getRebalanceId()The id of the latest started rebalance. -
getMembers
- Returns:
- The nodes that are members in both consistent hashes (if
pendingCH != null
, otherwise the members of the current CH). - See Also:
-
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:
-
getMembersPersistentUUIDs
-
wasTopologyRestoredFromState
public boolean wasTopologyRestoredFromState() -
getReadConsistentHash
Read operations should always go to the "current" owners. -
getWriteConsistentHash
When there is a rebalance in progress, write operations should go to the union of the "current" and "future" owners. -
equals
-
hashCode
public int hashCode() -
toString
-
logRoutingTableInformation
-
getPhase
-