public class SharedNothingBackupQuorum extends Object implements Quorum, org.apache.activemq.artemis.api.core.client.SessionFailureListener
| Modifier and Type | Class and Description |
|---|---|
static class |
SharedNothingBackupQuorum.BACKUP_ACTIVATION |
| Modifier and Type | Field and Description |
|---|---|
static int |
WAIT_TIME_AFTER_FIRST_LIVE_STOPPING_MSG
This is a safety net in case the live sends the first
ReplicationLiveIsStoppingMessage
with code ReplicationLiveIsStoppingMessage.LiveStopping.STOP_CALLED and crashes before sending the second with
ReplicationLiveIsStoppingMessage.LiveStopping.FAIL_OVER. |
| Constructor and Description |
|---|
SharedNothingBackupQuorum(StorageManager storageManager,
NodeManager nodeManager,
ScheduledExecutorService scheduledPool) |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeReconnect(org.apache.activemq.artemis.api.core.ActiveMQException exception) |
void |
causeExit(SharedNothingBackupQuorum.BACKUP_ACTIVATION explicitSignal)
Cause the Activation thread to exit and the server to be stopped.
|
void |
close()
called if the quorum manager is stopping so we can clean up
|
void |
connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException exception,
boolean failedOver)
if the connection to our replicated live goes down then decide on an action
|
void |
connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID) |
void |
decideOnAction(org.apache.activemq.artemis.core.client.impl.Topology topology) |
void |
failOver(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
Releases the latch, causing the backup activation thread to fail-over.
|
String |
getName()
the name of the Quorum.
|
void |
liveIDSet(String liveID) |
void |
nodeDown(org.apache.activemq.artemis.core.client.impl.Topology topology,
long eventUID,
String nodeID)
if the node going down is the node we are replicating from then decide on an action.
|
void |
nodeUp(org.apache.activemq.artemis.core.client.impl.Topology topology)
called by the quorum when a node in the quorum goes up
|
void |
notifyAlreadyReplicating() |
void |
notifyRegistrationFailed() |
void |
reset() |
void |
setQuorumManager(QuorumManager quorumManager)
called by the quorum manager when a quorum is registered
|
void |
setSessionFactory(org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal sessionFactory) |
SharedNothingBackupQuorum.BACKUP_ACTIVATION |
waitForStatusChange()
Called by the replicating backup (i.e.
|
public static final int WAIT_TIME_AFTER_FIRST_LIVE_STOPPING_MSG
ReplicationLiveIsStoppingMessage
with code ReplicationLiveIsStoppingMessage.LiveStopping.STOP_CALLED and crashes before sending the second with
ReplicationLiveIsStoppingMessage.LiveStopping.FAIL_OVER.
If the second message does come within this dead line, we fail over anyway.
public SharedNothingBackupQuorum(StorageManager storageManager, NodeManager nodeManager, ScheduledExecutorService scheduledPool)
public String getName()
Quorumpublic void decideOnAction(org.apache.activemq.artemis.core.client.impl.Topology topology)
public void liveIDSet(String liveID)
public void setQuorumManager(QuorumManager quorumManager)
QuorumsetQuorumManager in interface Quorumpublic void nodeDown(org.apache.activemq.artemis.core.client.impl.Topology topology,
long eventUID,
String nodeID)
public void nodeUp(org.apache.activemq.artemis.core.client.impl.Topology topology)
Quorumpublic void connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException exception,
boolean failedOver)
connectionFailed in interface org.apache.activemq.artemis.core.remoting.FailureListenerpublic void connectionFailed(org.apache.activemq.artemis.api.core.ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID)
connectionFailed in interface org.apache.activemq.artemis.core.remoting.FailureListenerpublic void beforeReconnect(org.apache.activemq.artemis.api.core.ActiveMQException exception)
beforeReconnect in interface org.apache.activemq.artemis.api.core.client.SessionFailureListenerpublic void close()
Quorumpublic void setSessionFactory(org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal sessionFactory)
sessionFactory - the session factory used to connect to the live serverpublic void failOver(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
The use case is for when the 'live' has an orderly shutdown, in which case it informs the backup that it should fail-over.
public void notifyRegistrationFailed()
public void notifyAlreadyReplicating()
public SharedNothingBackupQuorum.BACKUP_ACTIVATION waitForStatusChange()
public void causeExit(SharedNothingBackupQuorum.BACKUP_ACTIVATION explicitSignal)
explicitSignal - the state we want to set the quorum manager to returnpublic void reset()
Copyright © 2023 The Apache Software Foundation. All rights reserved.