Class SharedNothingBackupQuorum

    • Constructor Detail

      • SharedNothingBackupQuorum

        public SharedNothingBackupQuorum​(NodeManager nodeManager,
                                         ScheduledExecutorService scheduledPool,
                                         NetworkHealthCheck networkHealthCheck,
                                         int quorumSize,
                                         int voteRetries,
                                         long voteRetryWait,
                                         int quorumVoteWait,
                                         boolean failback)
    • Method Detail

      • getName

        public String getName()
        Description copied from interface: Quorum
        the name of the Quorum. this should be unique and is used to locate the correct quorum to use for voting
        Specified by:
        getName in interface Quorum
      • liveIDSet

        public void liveIDSet​(String liveID)
      • setQuorumManager

        public void setQuorumManager​(QuorumManager quorumManager)
        Description copied from interface: Quorum
        called by the quorum manager when a quorum is registered
        Specified by:
        setQuorumManager in interface Quorum
      • nodeDown

        public void nodeDown​(Topology topology,
                             long eventUID,
                             String nodeID)
        if the node going down is the node we are replicating from then decide on an action.
        Specified by:
        nodeDown in interface Quorum
        Parameters:
        topology -
        eventUID -
        nodeID -
      • nodeUp

        public void nodeUp​(Topology topology)
        Description copied from interface: Quorum
        called by the quorum when a node in the quorum goes up
        Specified by:
        nodeUp in interface Quorum
      • connectionFailed

        public void connectionFailed​(ActiveMQException exception,
                                     boolean failedOver)
        if the connection to our replicated live goes down then decide on an action
        Specified by:
        connectionFailed in interface FailureListener
        Parameters:
        exception - exception which has caused the connection to fail
      • connectionFailed

        public void connectionFailed​(ActiveMQException me,
                                     boolean failedOver,
                                     String scaleDownTargetNodeID)
        Description copied from interface: FailureListener
        Notifies that a connection has failed due to the specified exception.
        Specified by:
        connectionFailed in interface FailureListener
        Parameters:
        me - exception which has caused the connection to fail
        scaleDownTargetNodeID - the ID of the node to which messages are scaling down
      • beforeReconnect

        public void beforeReconnect​(ActiveMQException exception)
        Description copied from interface: SessionFailureListener
        Notifies that a connection has failed due to the specified exception.
        This method is called before the session attempts to reconnect/failover.
        Specified by:
        beforeReconnect in interface SessionFailureListener
        Parameters:
        exception - exception which has caused the connection to fail
      • close

        public void close()
        Description copied from interface: Quorum
        called if the quorum manager is stopping so we can clean up
        Specified by:
        close in interface Quorum
      • setSessionFactory

        public void setSessionFactory​(ClientSessionFactoryInternal sessionFactory)
        Parameters:
        sessionFactory - the session factory used to connect to the live server
      • failOver

        public void failOver​(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
        Releases the latch, causing the backup activation thread to fail-over.

        The use case is for when the 'live' has an orderly shutdown, in which case it informs the backup that it should fail-over.

      • waitForStatusChange

        public SharedNothingBackupQuorum.BACKUP_ACTIVATION waitForStatusChange()
        Called by the replicating backup (i.e. "SharedNothing" backup) to wait for the signal to fail-over or to stop.
        Returns:
        signal, indicating whether to stop or to fail-over
      • causeExit

        public void causeExit​(SharedNothingBackupQuorum.BACKUP_ACTIVATION explicitSignal)
        Cause the Activation thread to exit and the server to be stopped.
        Parameters:
        explicitSignal - the state we want to set the quorum manager to return
      • reset

        public void reset()