Class XSiteStateTransferManagerImpl

    • Constructor Detail

      • XSiteStateTransferManagerImpl

        public XSiteStateTransferManagerImpl()
    • Method Detail

      • addListener

        public void addListener()
      • removeListener

        public void removeListener()
      • notifyStatePushFinished

        public void notifyStatePushFinished​(java.lang.String siteName,
                                            Address node,
                                            boolean statusOk)
                                     throws java.lang.Throwable
        Description copied from interface: XSiteStateTransferManager
        It receives the notifications from local site when some node finishes pushing the state to the remote site.
        Specified by:
        notifyStatePushFinished in interface XSiteStateTransferManager
        Parameters:
        siteName - the remote site name
        node - the Address 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

        public final void startPushState​(java.lang.String siteName)
                                  throws java.lang.Throwable
        Description copied from interface: XSiteStateTransferManager
        It notifies all nodes from local site to start transfer the state to the remote site.
        Specified by:
        startPushState in interface XSiteStateTransferManager
        Parameters:
        siteName - the remote site name
        Throws:
        java.lang.Throwable - If some unexpected behavior occurs.
      • getStatus

        public java.util.Map<java.lang.String,​java.lang.String> getStatus()
        Specified by:
        getStatus in interface XSiteStateTransferManager
        Returns:
        the completed state transfer status for which this node is the coordinator.
      • cancelPushState

        public void cancelPushState​(java.lang.String siteName)
                             throws java.lang.Throwable
        Description copied from interface: XSiteStateTransferManager
        It cancels a running state transfer.
        Specified by:
        cancelPushState in interface XSiteStateTransferManager
        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.
      • getClusterStatus

        public java.util.Map<java.lang.String,​java.lang.String> getClusterStatus()
                                                                                throws java.lang.Exception
        Specified by:
        getClusterStatus in interface XSiteStateTransferManager
        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

        public void clearClusterStatus()
                                throws java.lang.Exception
        Description copied from interface: XSiteStateTransferManager
        Clears the completed state transfer status in all the cluster.
        Specified by:
        clearClusterStatus in interface XSiteStateTransferManager
        Throws:
        java.lang.Exception - if some exception occurs during the remote invocation.
      • getSendingSiteName

        public java.lang.String getSendingSiteName()
        Specified by:
        getSendingSiteName in interface XSiteStateTransferManager
        Returns:
        null if this node is not receiving state or the site name which is sending the state.
      • cancelReceive

        public void cancelReceive​(java.lang.String siteName)
                           throws java.lang.Exception
        Description copied from interface: XSiteStateTransferManager
        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.

        Specified by:
        cancelReceive in interface XSiteStateTransferManager
        Parameters:
        siteName - the site name which is sending the state.
        Throws:
        java.lang.Exception - if some exception occurs during the remote invocation.
      • becomeCoordinator

        public void becomeCoordinator​(java.lang.String siteName)
        Description copied from interface: XSiteStateTransferManager
        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.

        Specified by:
        becomeCoordinator in interface XSiteStateTransferManager
        Parameters:
        siteName - the site name.
      • handleTopology

        public <K,​V> void handleTopology​(TopologyChangedEvent<K,​V> topologyChangedEvent)