public class ClusterCacheStatus extends Object implements AvailabilityStrategyContext
| Modifier and Type | Field and Description |
|---|---|
static int |
INITIAL_REBALANCE_ID |
static int |
INITIAL_TOPOLOGY_ID |
| Constructor and Description |
|---|
ClusterCacheStatus(String cacheName,
AvailabilityStrategy availabilityStrategy,
ClusterTopologyManager clusterTopologyManager,
Transport transport) |
| Modifier and Type | Method and Description |
|---|---|
protected CacheTopology |
createInitialCacheTopology() |
void |
doConfirmRebalance(Address member,
int receivedTopologyId) |
void |
doHandleClusterView() |
CacheStatusResponse |
doJoin(Address joiner,
CacheJoinInfo joinInfo) |
void |
doLeave(Address leaver) |
void |
doMergePartitions(Map<Address,CacheStatusResponse> statusResponses,
List<Address> clusterMembers,
boolean isMergeView) |
void |
forceAvailabilityMode(AvailabilityMode newAvailabilityMode) |
void |
forceRebalance() |
AvailabilityMode |
getAvailabilityMode() |
String |
getCacheName() |
Map<Address,Float> |
getCapacityFactors() |
CacheTopology |
getCurrentTopology() |
List<Address> |
getExpectedMembers()
The members of the cache.
|
CacheJoinInfo |
getJoinInfo() |
RebalancingStatus |
getRebalancingStatus() |
CacheTopology |
getStableTopology()
Whenever a new cache topology without a
pendingCH and with at least numOwners owners for each
segment is installed, and the cache is AvailabilityMode.AVAILABLE, the current cache topology is marked
as the stable topology. |
boolean |
isDistributed() |
boolean |
isRebalanceEnabled() |
boolean |
isRebalanceInProgress() |
boolean |
isTotalOrder() |
void |
queueRebalance(List<Address> newMembers)
Queue (or start) a rebalance.
|
void |
setRebalanceEnabled(boolean enabled) |
void |
startQueuedRebalance() |
String |
toString() |
void |
updateAvailabilityMode(List<Address> actualMembers,
AvailabilityMode newAvailabilityMode,
boolean cancelRebalance)
Enter a new availability mode.
|
void |
updateCurrentTopology(List<Address> newMembers)
Use the configured
ConsistentHashFactory to create a new CH
with the given members, but do not start a rebalance. |
void |
updateTopologiesAfterMerge(CacheTopology currentTopology,
CacheTopology stableTopology,
AvailabilityMode availabilityMode)
Updates both the stable and the current topologies.
|
public static final int INITIAL_TOPOLOGY_ID
public static final int INITIAL_REBALANCE_ID
public ClusterCacheStatus(String cacheName, AvailabilityStrategy availabilityStrategy, ClusterTopologyManager clusterTopologyManager, Transport transport)
public CacheJoinInfo getJoinInfo()
public List<Address> getExpectedMembers()
AvailabilityStrategyContextCacheTopology.
Does not include nodes which have left the cluster (either gracefully or abruptly) but are still in the
current topology.getExpectedMembers in interface AvailabilityStrategyContextpublic void queueRebalance(List<Address> newMembers)
AvailabilityStrategyContextConsistentHashFactory to create a new balanced consistent hash
with the given members.
If there is no rebalance in progress, start a rebalance right away.
If there is a rebalance in progress, queue another rebalance.
If there is a rebalance in the queue as well, it will be replaced with the new one.
If newConsistentHash == null, remove any queued rebalance.queueRebalance in interface AvailabilityStrategyContextpublic boolean isTotalOrder()
public boolean isDistributed()
public CacheTopology getCurrentTopology()
getCurrentTopology in interface AvailabilityStrategyContextpublic CacheTopology getStableTopology()
AvailabilityStrategyContextpendingCH and with at least numOwners owners for each
segment is installed, and the cache is AvailabilityMode.AVAILABLE, the current cache topology is marked
as the stable topology.
The same happens when a rebalance is scheduled to start, but it doesn't do anything because the current
topology is already balanced.getStableTopology in interface AvailabilityStrategyContextnull.public AvailabilityMode getAvailabilityMode()
getAvailabilityMode in interface AvailabilityStrategyContextpublic void updateAvailabilityMode(List<Address> actualMembers, AvailabilityMode newAvailabilityMode, boolean cancelRebalance)
AvailabilityStrategyContextupdateAvailabilityMode in interface AvailabilityStrategyContextpublic void updateTopologiesAfterMerge(CacheTopology currentTopology, CacheTopology stableTopology, AvailabilityMode availabilityMode)
AvailabilityStrategyContextupdateTopologiesAfterMerge in interface AvailabilityStrategyContextpublic boolean isRebalanceInProgress()
public RebalancingStatus getRebalancingStatus()
public void doConfirmRebalance(Address member, int receivedTopologyId) throws Exception
Exceptionpublic void updateCurrentTopology(List<Address> newMembers)
AvailabilityStrategyContextConsistentHashFactory to create a new CH
with the given members, but do not start a rebalance.
Members missing from the current topology are ignored.updateCurrentTopology in interface AvailabilityStrategyContextpublic void doMergePartitions(Map<Address,CacheStatusResponse> statusResponses, List<Address> clusterMembers, boolean isMergeView) throws Exception
Exceptionpublic String getCacheName()
getCacheName in interface AvailabilityStrategyContextpublic CacheStatusResponse doJoin(Address joiner, CacheJoinInfo joinInfo) throws Exception
Exceptionprotected CacheTopology createInitialCacheTopology()
public void startQueuedRebalance()
public boolean isRebalanceEnabled()
public void setRebalanceEnabled(boolean enabled)
public void forceRebalance()
public void forceAvailabilityMode(AvailabilityMode newAvailabilityMode)
Copyright © 2024 JBoss, a division of Red Hat. All rights reserved.