Class NoOpXSiteStateTransferManager
java.lang.Object
org.infinispan.xsite.statetransfer.NoOpXSiteStateTransferManager
- All Implemented Interfaces:
XSiteStateTransferManager
A no-op implementation of
XSiteStateTransferManager.
This instance is used when cross-site replication is disabled.
- Since:
- 8.0
- Author:
- Pedro Ruivo
-
Field Summary
Fields inherited from interface org.infinispan.xsite.statetransfer.XSiteStateTransferManager
STATUS_CANCELED, STATUS_ERROR, STATUS_OK, STATUS_SENDING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbecomeCoordinator(String siteName) Makes this node the coordinator for the state transfer to the site name.voidcancelPushState(String siteName) It cancels a running state transfer.voidcancelReceive(String siteName) Sets the cluster to normal state.voidClears the completed state transfer status in all the cluster.voidClears the completed state transfer status.voidnotifyStatePushFinished(String siteName, Address node, boolean statusOk) It receives the notifications from local site when some node finishes pushing the state to the remote site.voidonTopologyUpdated(CacheTopology cacheTopology, boolean stateTransferInProgress) NotifiesXSiteStateTransferManagerthat a newCacheTopologyis installed and if the local cluster state transfer is in progress (or about to start)booleansetAutomaticStateTransfer(String site, XSiteStateTransferMode mode) Sets theXSiteStateTransferModeto the remote site.voidstartAutomaticStateTransferTo(ByteString remoteSite, boolean ignoreStatus) Starts the automatic cross-site state transfer if available and if required.voidstartPushState(String siteName) It notifies all nodes from local site to start transfer the state to the remote site.stateTransferMode(String site) toString()
-
Constructor Details
-
NoOpXSiteStateTransferManager
public NoOpXSiteStateTransferManager()
-
-
Method Details
-
notifyStatePushFinished
Description copied from interface:XSiteStateTransferManagerIt receives the notifications from local site when some node finishes pushing the state to the remote site.- Specified by:
notifyStatePushFinishedin interfaceXSiteStateTransferManager- Parameters:
siteName- the remote site namenode- theAddressfrom the node that finishes.statusOk-trueif no error or exception occurred during the state transfer.
-
startPushState
Description copied from interface:XSiteStateTransferManagerIt notifies all nodes from local site to start transfer the state to the remote site.- Specified by:
startPushStatein interfaceXSiteStateTransferManager- Parameters:
siteName- the remote site name
-
cancelPushState
Description copied from interface:XSiteStateTransferManagerIt cancels a running state transfer.- Specified by:
cancelPushStatein interfaceXSiteStateTransferManager- Parameters:
siteName- the site name to where the state is being sent.
-
getRunningStateTransfers
- Specified by:
getRunningStateTransfersin interfaceXSiteStateTransferManager- Returns:
- a list of site names in which this cache is pushing state.
-
getStatus
- Specified by:
getStatusin interfaceXSiteStateTransferManager- Returns:
- the completed state transfer status for which this node is the coordinator.
-
clearStatus
public void clearStatus()Description copied from interface:XSiteStateTransferManagerClears the completed state transfer status.- Specified by:
clearStatusin interfaceXSiteStateTransferManager
-
getClusterStatus
- Specified by:
getClusterStatusin interfaceXSiteStateTransferManager- Returns:
- the completed state transfer status from all the coordinators in the cluster.
-
clearClusterStatus
public void clearClusterStatus()Description copied from interface:XSiteStateTransferManagerClears the completed state transfer status in all the cluster.- Specified by:
clearClusterStatusin interfaceXSiteStateTransferManager
-
getSendingSiteName
- Specified by:
getSendingSiteNamein interfaceXSiteStateTransferManager- Returns:
nullif this node is not receiving state or the site name which is sending the state.
-
cancelReceive
Description copied from interface:XSiteStateTransferManagerSets the cluster to normal state. The main use for this method is when the link between the sites is broken and the receiver site keeps it state transfer state forever.- Specified by:
cancelReceivein interfaceXSiteStateTransferManager- Parameters:
siteName- the site name which is sending the state.
-
becomeCoordinator
Description copied from interface:XSiteStateTransferManagerMakes this node the coordinator for the state transfer to the site name. This method is invoked when the coordinator dies and this node receives a late start state transfer request.- Specified by:
becomeCoordinatorin interfaceXSiteStateTransferManager- Parameters:
siteName- the site name.
-
onTopologyUpdated
Description copied from interface:XSiteStateTransferManagerNotifiesXSiteStateTransferManagerthat a newCacheTopologyis installed and if the local cluster state transfer is in progress (or about to start)- Specified by:
onTopologyUpdatedin interfaceXSiteStateTransferManager- Parameters:
cacheTopology- The newCacheTopology.stateTransferInProgress-trueif the state transfer is in progress or starting.
-
getStateProvider
- Specified by:
getStateProviderin interfaceXSiteStateTransferManager- Returns:
- The
XSiteStateProviderinstance.
-
getStateConsumer
- Specified by:
getStateConsumerin interfaceXSiteStateTransferManager- Returns:
- The
XSiteStateConsumerinstance.
-
startAutomaticStateTransferTo
Description copied from interface:XSiteStateTransferManagerStarts the automatic cross-site state transfer if available and if required.- Specified by:
startAutomaticStateTransferToin interfaceXSiteStateTransferManager- Parameters:
remoteSite- The remote site to send state to.ignoreStatus- Iftrue, it starts the state transfer based only onXSiteStateTransferMode.
-
stateTransferMode
- Specified by:
stateTransferModein interfaceXSiteStateTransferManager- Parameters:
site- The remote site.- Returns:
- The
XSiteStateTransferModeconfigured for the remote site.
-
setAutomaticStateTransfer
Description copied from interface:XSiteStateTransferManagerSets theXSiteStateTransferModeto the remote site.If the configuration for the remote site does not support the
XSiteStateTransferMode, then this method returnsfalse.- Specified by:
setAutomaticStateTransferin interfaceXSiteStateTransferManager- Parameters:
site- The remote site.mode- The newXSiteStateTransferMode.- Returns:
falseif the site does not support the correspondingXSiteStateTransferMode.
-
toString
-