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()
AvailabilityStrategyContext
CacheTopology
.
Does not include nodes which have left the cluster (either gracefully or abruptly) but are still in the
current topology.getExpectedMembers
in interface AvailabilityStrategyContext
public void queueRebalance(List<Address> newMembers)
AvailabilityStrategyContext
ConsistentHashFactory
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 AvailabilityStrategyContext
public boolean isTotalOrder()
public boolean isDistributed()
public CacheTopology getCurrentTopology()
getCurrentTopology
in interface AvailabilityStrategyContext
public CacheTopology getStableTopology()
AvailabilityStrategyContext
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.
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 AvailabilityStrategyContext
null
.public AvailabilityMode getAvailabilityMode()
getAvailabilityMode
in interface AvailabilityStrategyContext
public void updateAvailabilityMode(List<Address> actualMembers, AvailabilityMode newAvailabilityMode, boolean cancelRebalance)
AvailabilityStrategyContext
updateAvailabilityMode
in interface AvailabilityStrategyContext
public void updateTopologiesAfterMerge(CacheTopology currentTopology, CacheTopology stableTopology, AvailabilityMode availabilityMode)
AvailabilityStrategyContext
updateTopologiesAfterMerge
in interface AvailabilityStrategyContext
public boolean isRebalanceInProgress()
public RebalancingStatus getRebalancingStatus()
public void doConfirmRebalance(Address member, int receivedTopologyId) throws Exception
Exception
public void updateCurrentTopology(List<Address> newMembers)
AvailabilityStrategyContext
ConsistentHashFactory
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 AvailabilityStrategyContext
public void doMergePartitions(Map<Address,CacheStatusResponse> statusResponses, List<Address> clusterMembers, boolean isMergeView) throws Exception
Exception
public String getCacheName()
getCacheName
in interface AvailabilityStrategyContext
public CacheStatusResponse doJoin(Address joiner, CacheJoinInfo joinInfo) throws Exception
Exception
protected CacheTopology createInitialCacheTopology()
public void startQueuedRebalance()
public boolean isRebalanceEnabled()
public void setRebalanceEnabled(boolean enabled)
public void forceRebalance()
public void forceAvailabilityMode(AvailabilityMode newAvailabilityMode)
Copyright © 2023 JBoss, a division of Red Hat. All rights reserved.