Class SharedNothingBackupActivation
- java.lang.Object
-
- org.apache.activemq.artemis.core.server.impl.Activation
-
- org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation
-
- All Implemented Interfaces:
Runnable,ReplicationEndpoint.ReplicationEndpointEventListener
public final class SharedNothingBackupActivation extends Activation implements ReplicationEndpoint.ReplicationEndpointEventListener
-
-
Constructor Summary
Constructors Constructor Description SharedNothingBackupActivation(ActiveMQServerImpl activeMQServer, boolean attemptFailBack, Map<String,Object> activationParams, IOCriticalErrorListener ioCriticalErrorListener, ReplicaPolicy replicaPolicy, NetworkHealthCheck networkHealthCheck)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose(boolean permanently, boolean restarting)JournalLoadercreateJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, ActiveMQServer parentServer)voidfailOver(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)Live has notified this server that it is going to stop.ReplicationEndpointgetReplicationEndpoint()voidhaStarted()voidinit()booleanisRemoteBackupUpToDate()Whether a remote backup server was in sync with its live server.booleanisReplicaSync()voidonLiveNodeId(String nodeId)voidonLiveStopping(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)voidonRemoteBackupUpToDate(String nodeId, long ignoredActivationSequence)voidpreStorageClose()voidrun()booleanwaitForBackupSync(long timeout, TimeUnit unit)Wait for backup synchronization when using synchronization-
Methods inherited from class org.apache.activemq.artemis.core.server.impl.Activation
freezeConnections, getActivationChannelHandler, getHAManager, getReplicationManager, postConnectionFreeze, sendLiveIsStopping
-
-
-
-
Constructor Detail
-
SharedNothingBackupActivation
public SharedNothingBackupActivation(ActiveMQServerImpl activeMQServer, boolean attemptFailBack, Map<String,Object> activationParams, IOCriticalErrorListener ioCriticalErrorListener, ReplicaPolicy replicaPolicy, NetworkHealthCheck networkHealthCheck)
-
-
Method Detail
-
close
public void close(boolean permanently, boolean restarting) throws Exception- Specified by:
closein classActivation- Throws:
Exception
-
preStorageClose
public void preStorageClose() throws Exception- Overrides:
preStorageClosein classActivation- Throws:
Exception
-
createJournalLoader
public JournalLoader createJournalLoader(PostOffice postOffice, PagingManager pagingManager, StorageManager storageManager, QueueFactory queueFactory, NodeManager nodeManager, ManagementService managementService, GroupingHandler groupingHandler, Configuration configuration, ActiveMQServer parentServer) throws ActiveMQException
- Overrides:
createJournalLoaderin classActivation- Throws:
ActiveMQException
-
haStarted
public void haStarted()
- Overrides:
haStartedin classActivation
-
waitForBackupSync
public boolean waitForBackupSync(long timeout, TimeUnit unit) throws InterruptedExceptionWait for backup synchronization when using synchronization- Parameters:
timeout-unit-- Returns:
trueif the server was already initialized or if it was initialized within the timeout period,falseotherwise.- Throws:
InterruptedException- See Also:
CountDownLatch.await(long, TimeUnit)
-
failOver
public void failOver(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
Live has notified this server that it is going to stop.
-
getReplicationEndpoint
public ReplicationEndpoint getReplicationEndpoint()
-
isRemoteBackupUpToDate
public boolean isRemoteBackupUpToDate()
Whether a remote backup server was in sync with its live server. If it was not in sync, it may not take over the live's functions.A local backup server or a live server should always return
true- Returns:
- whether the backup is up-to-date, if the server is not a backup it always returns
true.
-
onLiveNodeId
public void onLiveNodeId(String nodeId)
- Specified by:
onLiveNodeIdin interfaceReplicationEndpoint.ReplicationEndpointEventListener
-
onRemoteBackupUpToDate
public void onRemoteBackupUpToDate(String nodeId, long ignoredActivationSequence)
- Specified by:
onRemoteBackupUpToDatein interfaceReplicationEndpoint.ReplicationEndpointEventListener
-
onLiveStopping
public void onLiveStopping(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage) throws ActiveMQException
- Specified by:
onLiveStoppingin interfaceReplicationEndpoint.ReplicationEndpointEventListener- Throws:
ActiveMQException
-
isReplicaSync
public boolean isReplicaSync()
- Overrides:
isReplicaSyncin classActivation
-
-