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