Package org.infinispan.topology
Class ClusterTopologyManagerImpl
java.lang.Object
org.infinispan.topology.ClusterTopologyManagerImpl
- All Implemented Interfaces:
GlobalStateProvider,ClusterTopologyManager
public class ClusterTopologyManagerImpl
extends Object
implements ClusterTopologyManager, GlobalStateProvider
The
ClusterTopologyManager implementation.- Since:
- 5.2
- Author:
- Dan Berindei, Pedro Ruivo
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.infinispan.topology.ClusterTopologyManager
ClusterTopologyManager.ClusterManagerStatus -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbroadcastShutdownCache(String cacheName) currentJoiners(String cacheName) Returns the list of nodes that joined the cache with the givencacheNameif the current node is the coordinator.static booleandistLostDataCheck(ConsistentHash stableCH, List<Address> newMembers) forceAvailabilityMode(String cacheName, AvailabilityMode availabilityMode) forceRebalance(String cacheName) getRebalancingStatus(String cacheName) Retrieves the rebalancing status of a cachehandleJoin(String cacheName, Address joiner, CacheJoinInfo joinInfo, int joinerViewId) Signals that a new member is joining the cache.handleLeave(String cacheName, Address leaver, int viewId) Signals that a member is leaving the cache.handleRebalancePhaseConfirm(String cacheName, Address node, int topologyId, Throwable throwable, int viewId) Marks the rebalance as complete on the sender.handleShutdownRequest(String cacheName) booleanbooleanisRebalancingEnabled(String cacheName) Returns whether rebalancing is enabled or disabled for this container.voidprepareForPersist(ScopedPersistentState globalState) This method is invoked by theGlobalStateManagerjust before persisting the global statevoidprepareForRestore(ScopedPersistentState globalState) This method is invoked by theGlobalStateManagerafter starting up to notify that global state has been restored.voidpreStart()static booleanscatteredLostDataCheck(ConsistentHash stableCH, List<Address> newMembers) voidsetInitialCacheTopologyId(String cacheName, int topologyId) Sets the id of the initial topology in given cache.setRebalancingEnabled(boolean enabled) Globally enables or disables whether automatic rebalancing should occur.setRebalancingEnabled(String cacheName, boolean enabled) Enables or disables rebalancing for the specified cachevoidstart()voidstop()booleanuseCurrentTopologyAsStable(String cacheName, boolean force)
-
Field Details
-
INITIAL_CONNECTION_ATTEMPTS
public static final int INITIAL_CONNECTION_ATTEMPTS- See Also:
-
CLUSTER_RECOVERY_ATTEMPTS
public static final int CLUSTER_RECOVERY_ATTEMPTS- See Also:
-
-
Constructor Details
-
ClusterTopologyManagerImpl
public ClusterTopologyManagerImpl()
-
-
Method Details
-
preStart
public void preStart() -
start
public void start() -
stop
public void stop() -
getStatus
- Specified by:
getStatusin interfaceClusterTopologyManager
-
currentJoiners
Description copied from interface:ClusterTopologyManagerReturns the list of nodes that joined the cache with the givencacheNameif the current node is the coordinator. If the node is not the coordinator, the method returns null.- Specified by:
currentJoinersin interfaceClusterTopologyManager
-
handleJoin
public CompletionStage<CacheStatusResponse> handleJoin(String cacheName, Address joiner, CacheJoinInfo joinInfo, int joinerViewId) Description copied from interface:ClusterTopologyManagerSignals that a new member is joining the cache. The returnedCacheStatusResponse.cacheTopologyis 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 nevernull.- Specified by:
handleJoinin interfaceClusterTopologyManager
-
handleLeave
public CompletionStage<Void> handleLeave(String cacheName, Address leaver, int viewId) throws Exception Description copied from interface:ClusterTopologyManagerSignals that a member is leaving the cache.- Specified by:
handleLeavein interfaceClusterTopologyManager- Throws:
Exception
-
handleRebalancePhaseConfirm
public CompletionStage<Void> handleRebalancePhaseConfirm(String cacheName, Address node, int topologyId, Throwable throwable, int viewId) throws Exception Description copied from interface:ClusterTopologyManagerMarks the rebalance as complete on the sender.- Specified by:
handleRebalancePhaseConfirmin interfaceClusterTopologyManager- Throws:
Exception
-
prepareForPersist
Description copied from interface:GlobalStateProviderThis method is invoked by theGlobalStateManagerjust before persisting the global state- Specified by:
prepareForPersistin interfaceGlobalStateProvider
-
prepareForRestore
Description copied from interface:GlobalStateProviderThis method is invoked by theGlobalStateManagerafter starting up to notify that global state has been restored.- Specified by:
prepareForRestorein interfaceGlobalStateProvider
-
isRebalancingEnabled
public boolean isRebalancingEnabled()- Specified by:
isRebalancingEnabledin interfaceClusterTopologyManager
-
isRebalancingEnabled
Description copied from interface:ClusterTopologyManagerReturns whether rebalancing is enabled or disabled for this container.- Specified by:
isRebalancingEnabledin interfaceClusterTopologyManager
-
setRebalancingEnabled
Description copied from interface:ClusterTopologyManagerEnables or disables rebalancing for the specified cache- Specified by:
setRebalancingEnabledin interfaceClusterTopologyManager
-
setRebalancingEnabled
Description copied from interface:ClusterTopologyManagerGlobally enables or disables whether automatic rebalancing should occur.- Specified by:
setRebalancingEnabledin interfaceClusterTopologyManager
-
forceRebalance
- Specified by:
forceRebalancein interfaceClusterTopologyManager
-
forceAvailabilityMode
public CompletionStage<Void> forceAvailabilityMode(String cacheName, AvailabilityMode availabilityMode) - Specified by:
forceAvailabilityModein interfaceClusterTopologyManager
-
getRebalancingStatus
Description copied from interface:ClusterTopologyManagerRetrieves the rebalancing status of a cache- Specified by:
getRebalancingStatusin interfaceClusterTopologyManager
-
broadcastShutdownCache
-
setInitialCacheTopologyId
Description copied from interface:ClusterTopologyManagerSets the id of the initial topology in given cache. This is necessary when using entry versions that contain topology id; had we started with topology id 1, newer versions would not be recognized properly.- Specified by:
setInitialCacheTopologyIdin interfaceClusterTopologyManager
-
handleShutdownRequest
- Specified by:
handleShutdownRequestin interfaceClusterTopologyManager- Throws:
Exception
-
scatteredLostDataCheck
-
useCurrentTopologyAsStable
- Specified by:
useCurrentTopologyAsStablein interfaceClusterTopologyManager
-
distLostDataCheck
-