public class ClusterTopologyManagerImpl extends Object implements ClusterTopologyManager
ClusterTopologyManager
implementation.Modifier and Type | Class and Description |
---|---|
class |
ClusterTopologyManagerImpl.ClusterViewListener |
ClusterTopologyManager.ClusterManagerStatus
Modifier and Type | Field and Description |
---|---|
static int |
CLUSTER_RECOVERY_ATTEMPTS |
static int |
INITIAL_CONNECTION_ATTEMPTS |
Constructor and Description |
---|
ClusterTopologyManagerImpl() |
Modifier and Type | Method and Description |
---|---|
CompletionStage<Void> |
broadcastShutdownCache(String cacheName) |
static boolean |
distLostDataCheck(ConsistentHash stableCH,
List<Address> newMembers) |
CompletionStage<Void> |
forceAvailabilityMode(String cacheName,
AvailabilityMode availabilityMode) |
CompletionStage<Void> |
forceRebalance(String cacheName) |
RebalancingStatus |
getRebalancingStatus(String cacheName)
Retrieves the rebalancing status of a cache
|
ClusterTopologyManager.ClusterManagerStatus |
getStatus() |
CompletionStage<CacheStatusResponse> |
handleJoin(String cacheName,
Address joiner,
CacheJoinInfo joinInfo,
int joinerViewId)
Signals that a new member is joining the cache.
|
CompletionStage<Void> |
handleLeave(String cacheName,
Address leaver,
int viewId)
Signals that a member is leaving the cache.
|
CompletionStage<Void> |
handleRebalancePhaseConfirm(String cacheName,
Address node,
int topologyId,
Throwable throwable,
int viewId)
Marks the rebalance as complete on the sender.
|
CompletionStage<Void> |
handleShutdownRequest(String cacheName) |
boolean |
isRebalancingEnabled() |
boolean |
isRebalancingEnabled(String cacheName)
Returns whether rebalancing is enabled or disabled for this container.
|
static boolean |
scatteredLostDataCheck(ConsistentHash stableCH,
List<Address> newMembers) |
void |
setInitialCacheTopologyId(String cacheName,
int topologyId)
Sets the id of the initial topology in given cache.
|
CompletionStage<Void> |
setRebalancingEnabled(boolean enabled)
Globally enables or disables whether automatic rebalancing should occur.
|
CompletionStage<Void> |
setRebalancingEnabled(String cacheName,
boolean enabled)
Enables or disables rebalancing for the specified cache
|
void |
start() |
void |
stop() |
public static final int INITIAL_CONNECTION_ATTEMPTS
public static final int CLUSTER_RECOVERY_ATTEMPTS
public void start()
public void stop()
public ClusterTopologyManager.ClusterManagerStatus getStatus()
getStatus
in interface ClusterTopologyManager
public CompletionStage<CacheStatusResponse> handleJoin(String cacheName, Address joiner, CacheJoinInfo joinInfo, int joinerViewId)
ClusterTopologyManager
CacheStatusResponse.cacheTopology
is the current cache topology before the node joined.
If the node is the first to join the cache, the returned topology does include the joiner,
and it is never null
.handleJoin
in interface ClusterTopologyManager
public CompletionStage<Void> handleLeave(String cacheName, Address leaver, int viewId) throws Exception
ClusterTopologyManager
handleLeave
in interface ClusterTopologyManager
Exception
public CompletionStage<Void> handleRebalancePhaseConfirm(String cacheName, Address node, int topologyId, Throwable throwable, int viewId) throws Exception
ClusterTopologyManager
handleRebalancePhaseConfirm
in interface ClusterTopologyManager
Exception
public boolean isRebalancingEnabled()
isRebalancingEnabled
in interface ClusterTopologyManager
public boolean isRebalancingEnabled(String cacheName)
ClusterTopologyManager
isRebalancingEnabled
in interface ClusterTopologyManager
public CompletionStage<Void> setRebalancingEnabled(String cacheName, boolean enabled)
ClusterTopologyManager
setRebalancingEnabled
in interface ClusterTopologyManager
public CompletionStage<Void> setRebalancingEnabled(boolean enabled)
ClusterTopologyManager
setRebalancingEnabled
in interface ClusterTopologyManager
public CompletionStage<Void> forceRebalance(String cacheName)
forceRebalance
in interface ClusterTopologyManager
public CompletionStage<Void> forceAvailabilityMode(String cacheName, AvailabilityMode availabilityMode)
forceAvailabilityMode
in interface ClusterTopologyManager
public RebalancingStatus getRebalancingStatus(String cacheName)
ClusterTopologyManager
getRebalancingStatus
in interface ClusterTopologyManager
public CompletionStage<Void> broadcastShutdownCache(String cacheName)
public void setInitialCacheTopologyId(String cacheName, int topologyId)
ClusterTopologyManager
setInitialCacheTopologyId
in interface ClusterTopologyManager
public CompletionStage<Void> handleShutdownRequest(String cacheName) throws Exception
handleShutdownRequest
in interface ClusterTopologyManager
Exception
public static boolean scatteredLostDataCheck(ConsistentHash stableCH, List<Address> newMembers)
public static boolean distLostDataCheck(ConsistentHash stableCH, List<Address> newMembers)
Copyright © 2021 JBoss by Red Hat. All rights reserved.