public class SharedNothingBackupQuorum extends Object implements Quorum, 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,
NetworkHealthCheck networkHealthCheck) |
Modifier and Type | Method and Description |
---|---|
void |
beforeReconnect(ActiveMQException exception)
Notifies that a connection has failed due to the specified 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(ActiveMQException exception,
boolean failedOver)
if the connection to our replicated live goes down then decide on an action
|
void |
connectionFailed(ActiveMQException me,
boolean failedOver,
String scaleDownTargetNodeID)
Notifies that a connection has failed due to the specified exception.
|
void |
decideOnAction(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(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(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(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, NetworkHealthCheck networkHealthCheck)
public String getName()
Quorum
public void decideOnAction(Topology topology)
public void liveIDSet(String liveID)
public void setQuorumManager(QuorumManager quorumManager)
Quorum
setQuorumManager
in interface Quorum
public void nodeDown(Topology topology, long eventUID, String nodeID)
public void nodeUp(Topology topology)
Quorum
public void connectionFailed(ActiveMQException exception, boolean failedOver)
connectionFailed
in interface FailureListener
exception
- exception which has caused the connection to failpublic void connectionFailed(ActiveMQException me, boolean failedOver, String scaleDownTargetNodeID)
FailureListener
connectionFailed
in interface FailureListener
me
- exception which has caused the connection to failscaleDownTargetNodeID
- the ID of the node to which messages are scaling downpublic void beforeReconnect(ActiveMQException exception)
SessionFailureListener
beforeReconnect
in interface SessionFailureListener
exception
- exception which has caused the connection to failpublic void close()
Quorum
public void setSessionFactory(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 © 2017 JBoss by Red Hat. All rights reserved.