Interface XSiteStateTransferManager
-
- All Known Implementing Classes:
XSiteStateTransferManagerImpl
public interface XSiteStateTransferManagerIt manages the state transfer between sites.- Since:
- 7.0
- Author:
- Pedro Ruivo
-
-
Field Summary
Fields Modifier and Type Field Description static StringSTATUS_CANCELEDstatic StringSTATUS_ERRORstatic StringSTATUS_OKstatic StringSTATUS_SENDING
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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()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.voidstartPushState(String siteName)It notifies all nodes from local site to start transfer the state to the remote site.
-
-
-
Field Detail
-
STATUS_OK
static final String STATUS_OK
- See Also:
- Constant Field Values
-
STATUS_ERROR
static final String STATUS_ERROR
- See Also:
- Constant Field Values
-
STATUS_SENDING
static final String STATUS_SENDING
- See Also:
- Constant Field Values
-
STATUS_CANCELED
static final String STATUS_CANCELED
- See Also:
- Constant Field Values
-
-
Method Detail
-
notifyStatePushFinished
void notifyStatePushFinished(String siteName, Address node, boolean statusOk) throws Throwable
It receives the notifications from local site when some node finishes pushing the state to the remote site.
-
startPushState
void startPushState(String siteName) throws Throwable
It notifies all nodes from local site to start transfer the state to the remote site.- Parameters:
siteName- the remote site name- Throws:
Throwable- If some unexpected behavior occurs.
-
cancelPushState
void cancelPushState(String siteName) throws Throwable
It cancels a running state transfer.- 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.
-
getRunningStateTransfers
List<String> getRunningStateTransfers()
- Returns:
- a list of site names in which this cache is pushing state.
-
getStatus
Map<String,String> getStatus()
- Returns:
- the completed state transfer status for which this node is the coordinator.
-
clearStatus
void clearStatus()
Clears the completed state transfer status.
-
getClusterStatus
Map<String,String> getClusterStatus() throws Exception
- Returns:
- the completed state transfer status from all the coordinators in the cluster.
- Throws:
Exception- if some exception during the remote invocation occurs.
-
clearClusterStatus
void clearClusterStatus() throws ExceptionClears the completed state transfer status in all the cluster.- Throws:
Exception- if some exception occurs during the remote invocation.
-
getSendingSiteName
String getSendingSiteName()
- Returns:
nullif this node is not receiving state or the site name which is sending the state.
-
cancelReceive
void cancelReceive(String siteName) throws Exception
Sets 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.- Parameters:
siteName- the site name which is sending the state.- Throws:
Exception- if some exception occurs during the remote invocation.
-
becomeCoordinator
void becomeCoordinator(String siteName)
Makes 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.- Parameters:
siteName- the site name.
-
-