Class XSiteStateTransferManagerImpl
- java.lang.Object
-
- org.infinispan.xsite.statetransfer.XSiteStateTransferManagerImpl
-
- All Implemented Interfaces:
XSiteStateTransferManager
public class XSiteStateTransferManagerImpl extends Object implements XSiteStateTransferManager
XSiteStateTransferManagerimplementation.- Since:
- 7.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 Constructor Description XSiteStateTransferManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener()voidbecomeCoordinator(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.voidclearClusterStatus()Clears the completed state transfer status in all the cluster.voidclearStatus()Clears the completed state transfer status.Map<String,String>getClusterStatus()List<String>getRunningStateTransfers()StringgetSendingSiteName()Map<String,String>getStatus()<K,V>
voidhandleTopology(TopologyChangedEvent<K,V> topologyChangedEvent)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.voidremoveListener()voidstartPushState(String siteName)It notifies all nodes from local site to start transfer the state to the remote site.
-
-
-
Method Detail
-
addListener
public void addListener()
-
removeListener
public void removeListener()
-
notifyStatePushFinished
public void notifyStatePushFinished(String siteName, Address node, boolean statusOk) throws Throwable
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.- Throws:
Throwable- If some unexpected behavior occurs.
-
startPushState
public final void startPushState(String siteName) throws Throwable
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- Throws:
Throwable- If some unexpected behavior occurs.
-
getRunningStateTransfers
public List<String> getRunningStateTransfers()
- Specified by:
getRunningStateTransfersin interfaceXSiteStateTransferManager- Returns:
- a list of site names in which this cache is pushing state.
-
getStatus
public Map<String,String> 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
-
cancelPushState
public void cancelPushState(String siteName) throws Throwable
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.- Throws:
Throwable- if some exception occurs during the remote invocation with the local cluster or remote site.
-
getClusterStatus
public Map<String,String> getClusterStatus() throws Exception
- Specified by:
getClusterStatusin interfaceXSiteStateTransferManager- Returns:
- the completed state transfer status from all the coordinators in the cluster.
- Throws:
Exception- if some exception during the remote invocation occurs.
-
clearClusterStatus
public void clearClusterStatus() throws ExceptionDescription copied from interface:XSiteStateTransferManagerClears the completed state transfer status in all the cluster.- Specified by:
clearClusterStatusin interfaceXSiteStateTransferManager- Throws:
Exception- if some exception occurs during the remote invocation.
-
getSendingSiteName
public String getSendingSiteName()
- Specified by:
getSendingSiteNamein interfaceXSiteStateTransferManager- Returns:
nullif this node is not receiving state or the site name which is sending the state.
-
cancelReceive
public void cancelReceive(String siteName) throws Exception
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.- Throws:
Exception- if some exception occurs during the remote invocation.
-
becomeCoordinator
public void becomeCoordinator(String siteName)
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.
-
handleTopology
public <K,V> void handleTopology(TopologyChangedEvent<K,V> topologyChangedEvent)
-
-