@MBean(objectName="LocalTopologyManager",
description="Controls the cache membership and state transfer")
public class LocalTopologyManagerImpl
extends Object
implements LocalTopologyManager, GlobalStateProvider
LocalTopologyManager implementation.| Constructor and Description |
|---|
LocalTopologyManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheShutdown(String name)
Initiates a cluster-wide cache shutdown for the specified cache
|
void |
confirmRebalancePhase(String cacheName,
int topologyId,
int rebalanceId,
Throwable throwable)
Confirm that the local cache
cacheName has finished receiving the new data for topology
topologyId. |
CompletionStage<Object> |
executeOnCoordinatorRetry(ReplicableCommand command,
int viewId,
long endNanos) |
AvailabilityMode |
getCacheAvailability(String cacheName)
Retrieves the availability state of a cache.
|
CacheTopology |
getCacheTopology(String cacheName) |
String |
getClusterAvailability() |
PersistentUUID |
getPersistentUUID()
Returns the local UUID of this node.
|
RebalancingStatus |
getRebalancingStatus(String cacheName)
Retrieve the rebalancing status for the specified cache
|
CacheTopology |
getStableCacheTopology(String cacheName) |
CompletionStage<Void> |
handleCacheShutdown(String cacheName)
Handles the local operations related to gracefully shutting down a cache
|
CompletionStage<CacheTopology> |
handleJoinResponse(String cacheName,
org.infinispan.topology.LocalCacheStatus cacheStatus,
CacheStatusResponse initialStatus) |
CompletionStage<Void> |
handleRebalance(String cacheName,
CacheTopology cacheTopology,
int viewId,
Address sender)
Performs the state transfer.
|
CompletionStage<Void> |
handleStableTopologyUpdate(String cacheName,
CacheTopology newStableTopology,
Address sender,
int viewId)
Update the stable cache topology.
|
CompletionStage<ManagerStatusResponse> |
handleStatusRequest(int viewId)
Recovers the current topology information for all running caches and returns it to the coordinator.
|
CompletionStage<Void> |
handleTopologyUpdate(String cacheName,
CacheTopology cacheTopology,
AvailabilityMode availabilityMode,
int viewId,
Address sender)
Updates the current and/or pending consistent hash, without transferring any state.
|
boolean |
isCacheRebalancingEnabled(String cacheName)
Checks whether rebalancing is enabled for the specified cache.
|
boolean |
isRebalancingEnabled()
Checks whether rebalancing is enabled for the entire cluster.
|
CompletionStage<CacheTopology> |
join(String cacheName,
CacheJoinInfo joinInfo,
CacheTopologyHandler stm,
PartitionHandlingManager phm)
Forwards the join request to the coordinator.
|
void |
leave(String cacheName,
long timeout)
Forwards the leave request to the coordinator.
|
void |
prepareForPersist(ScopedPersistentState state)
This method is invoked by the
GlobalStateManager just before
persisting the global state |
void |
prepareForRestore(ScopedPersistentState state)
This method is invoked by the
GlobalStateManager after starting up to notify
that global state has been restored. |
void |
preStart() |
CompletionStage<CacheStatusResponse> |
sendJoinRequest(String cacheName,
CacheJoinInfo joinInfo,
long timeout,
long endTime) |
void |
setCacheAvailability(String cacheName,
AvailabilityMode availabilityMode)
Updates the availability state of a cache (for the entire cluster).
|
void |
setCacheRebalancingEnabled(String cacheName,
boolean enabled)
Enable or disable rebalancing for the specified cache.
|
void |
setRebalancingEnabled(boolean enabled)
Enable or disable rebalancing in the entire cluster.
|
void |
start() |
void |
stop() |
public void preStart()
public void start()
public void stop()
public CompletionStage<CacheTopology> join(String cacheName, CacheJoinInfo joinInfo, CacheTopologyHandler stm, PartitionHandlingManager phm)
LocalTopologyManagerjoin in interface LocalTopologyManagerpublic CompletionStage<CacheStatusResponse> sendJoinRequest(String cacheName, CacheJoinInfo joinInfo, long timeout, long endTime)
public CompletionStage<CacheTopology> handleJoinResponse(String cacheName, org.infinispan.topology.LocalCacheStatus cacheStatus, CacheStatusResponse initialStatus)
public void leave(String cacheName, long timeout)
LocalTopologyManagerleave in interface LocalTopologyManagerpublic void confirmRebalancePhase(String cacheName, int topologyId, int rebalanceId, Throwable throwable)
LocalTopologyManagercacheName has finished receiving the new data for topology
topologyId.
The coordinator can change during the state transfer, so we make the rebalance RPC async and we send the response as a different command.
confirmRebalancePhase in interface LocalTopologyManagercacheName - the name of the cachetopologyId - the current topology id of the node at the time the rebalance is completed.rebalanceId - the id of the current rebalancethrowable - null unless local rebalance ended because of an error.public CompletionStage<ManagerStatusResponse> handleStatusRequest(int viewId)
LocalTopologyManagerhandleStatusRequest in interface LocalTopologyManagerviewId - The coordinator's view idpublic CompletionStage<Void> handleTopologyUpdate(String cacheName, CacheTopology cacheTopology, AvailabilityMode availabilityMode, int viewId, Address sender)
LocalTopologyManagerhandleTopologyUpdate in interface LocalTopologyManagerpublic CompletionStage<Void> handleStableTopologyUpdate(String cacheName, CacheTopology newStableTopology, Address sender, int viewId)
LocalTopologyManagerMostly needed for backup, so that a new coordinator can recover the stable topology of the cluster.
handleStableTopologyUpdate in interface LocalTopologyManagerpublic CompletionStage<Void> handleRebalance(String cacheName, CacheTopology cacheTopology, int viewId, Address sender)
LocalTopologyManagerhandleRebalance in interface LocalTopologyManagerpublic CacheTopology getCacheTopology(String cacheName)
getCacheTopology in interface LocalTopologyManagerpublic CacheTopology getStableCacheTopology(String cacheName)
getStableCacheTopology in interface LocalTopologyManager@ManagedAttribute(description="Rebalancing enabled",
displayName="Rebalancing enabled",
dataType=TRAIT,
writable=true)
public boolean isRebalancingEnabled()
LocalTopologyManagerisRebalancingEnabled in interface LocalTopologyManagerpublic void setRebalancingEnabled(boolean enabled)
LocalTopologyManagersetRebalancingEnabled in interface LocalTopologyManagerpublic boolean isCacheRebalancingEnabled(String cacheName)
LocalTopologyManagerisCacheRebalancingEnabled in interface LocalTopologyManagerpublic CompletionStage<Object> executeOnCoordinatorRetry(ReplicableCommand command, int viewId, long endNanos)
public void setCacheRebalancingEnabled(String cacheName, boolean enabled)
LocalTopologyManagersetCacheRebalancingEnabled in interface LocalTopologyManagerpublic RebalancingStatus getRebalancingStatus(String cacheName)
LocalTopologyManagergetRebalancingStatus in interface LocalTopologyManager@ManagedAttribute(description="Cluster availability",
displayName="Cluster availability",
dataType=TRAIT,
writable=false)
public String getClusterAvailability()
public AvailabilityMode getCacheAvailability(String cacheName)
LocalTopologyManagergetCacheAvailability in interface LocalTopologyManagerpublic void setCacheAvailability(String cacheName, AvailabilityMode availabilityMode)
LocalTopologyManagersetCacheAvailability in interface LocalTopologyManagerpublic void cacheShutdown(String name)
LocalTopologyManagercacheShutdown in interface LocalTopologyManagerpublic CompletionStage<Void> handleCacheShutdown(String cacheName)
LocalTopologyManagerhandleCacheShutdown in interface LocalTopologyManagerpublic void prepareForPersist(ScopedPersistentState state)
GlobalStateProviderGlobalStateManager just before
persisting the global stateprepareForPersist in interface GlobalStateProviderpublic void prepareForRestore(ScopedPersistentState state)
GlobalStateProviderGlobalStateManager after starting up to notify
that global state has been restored.prepareForRestore in interface GlobalStateProviderpublic PersistentUUID getPersistentUUID()
LocalTopologyManagergetPersistentUUID in interface LocalTopologyManagerCopyright © 2022 JBoss by Red Hat. All rights reserved.