Class SharedNothingBackupQuorum

java.lang.Object
org.apache.activemq.artemis.core.server.cluster.quorum.SharedNothingBackupQuorum
All Implemented Interfaces:
SessionFailureListener, FailureListener, Quorum, NodeLocator.BackupRegistrationListener

public class SharedNothingBackupQuorum extends Object implements Quorum, SessionFailureListener, NodeLocator.BackupRegistrationListener
  • Field Details

  • Constructor Details

  • Method Details

    • 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
    • primaryIDSet

      public void primaryIDSet(String primaryID)
    • 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
    • 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 primary 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 primary server
    • failOver

      public void failOver(ReplicationPrimaryIsStoppingMessage.PrimaryStopping 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.

    • onBackupRegistrationFailed

      public void onBackupRegistrationFailed(boolean alreadyReplicating)
      Specified by:
      onBackupRegistrationFailed in interface NodeLocator.BackupRegistrationListener
    • 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()