public final class ReplicationManager extends Object implements ActiveMQComponent
Its equivalent in the backup server is ReplicationEndpoint
.
ReplicationEndpoint
Modifier and Type | Class and Description |
---|---|
static class |
ReplicationManager.ADD_OPERATION_TYPE |
Constructor and Description |
---|
ReplicationManager(CoreRemotingConnection remotingConnection,
long timeout,
long initialReplicationSyncTimeout,
ExecutorFactory executorFactory) |
Modifier and Type | Method and Description |
---|---|
void |
appendAddRecordTransactional(byte journalID,
ReplicationManager.ADD_OPERATION_TYPE operation,
long txID,
long id,
byte recordType,
EncodingSupport record) |
void |
appendCommitRecord(byte journalID,
long txID,
boolean sync,
boolean lineUp) |
void |
appendDeleteRecord(byte journalID,
long id) |
void |
appendDeleteRecordTransactional(byte journalID,
long txID,
long id) |
void |
appendDeleteRecordTransactional(byte journalID,
long txID,
long id,
EncodingSupport record) |
void |
appendPrepareRecord(byte journalID,
long txID,
EncodingSupport transactionData) |
void |
appendRollbackRecord(byte journalID,
long txID) |
void |
appendUpdateRecord(byte journalID,
ReplicationManager.ADD_OPERATION_TYPE operation,
long id,
byte recordType,
EncodingSupport record) |
void |
clearReplicationTokens()
Completes any pending operations.
|
Set<OperationContext> |
getActiveTokens()
A list of tokens that are still waiting for replications to be completed
|
CoreRemotingConnection |
getBackupTransportConnection()
Used while stopping the server to ensure that we freeze communications with the backup.
|
boolean |
isStarted() |
boolean |
isSynchronizing() |
void |
largeMessageBegin(long messageId) |
void |
largeMessageDelete(Long messageId,
JournalStorageManager storageManager) |
void |
largeMessageWrite(long messageId,
byte[] body) |
void |
pageClosed(SimpleString storeName,
int pageNumber) |
void |
pageDeleted(SimpleString storeName,
int pageNumber) |
void |
pageWrite(PagedMessage message,
int pageNumber) |
void |
sendLargeMessageIdListMessage(Map<Long,Pair<String,Long>> largeMessages)
Reserves several LargeMessage IDs in the backup.
|
OperationContext |
sendLiveIsStopping(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
Notifies the backup that the live server is stopping.
|
void |
sendStartSyncMessage(JournalFile[] datafiles,
AbstractJournalStorageManager.JournalContent contentType,
String nodeID,
boolean allowsAutoFailBack)
Reserve the following fileIDs in the backup server.
|
void |
sendSynchronizationDone(String nodeID,
long initialReplicationSyncTimeout)
Informs backup that data synchronization is done.
|
void |
start() |
void |
stop() |
void |
syncJournalFile(JournalFile jf,
AbstractJournalStorageManager.JournalContent content)
Sends the whole content of the file to be duplicated.
|
void |
syncLargeMessageFile(SequentialFile file,
long size,
long id) |
void |
syncPages(SequentialFile file,
long id,
SimpleString queueName) |
public ReplicationManager(CoreRemotingConnection remotingConnection, long timeout, long initialReplicationSyncTimeout, ExecutorFactory executorFactory)
remotingConnection
- public void appendUpdateRecord(byte journalID, ReplicationManager.ADD_OPERATION_TYPE operation, long id, byte recordType, EncodingSupport record) throws Exception
Exception
public void appendDeleteRecord(byte journalID, long id) throws Exception
Exception
public void appendAddRecordTransactional(byte journalID, ReplicationManager.ADD_OPERATION_TYPE operation, long txID, long id, byte recordType, EncodingSupport record) throws Exception
Exception
public void appendCommitRecord(byte journalID, long txID, boolean sync, boolean lineUp) throws Exception
Exception
public void appendDeleteRecordTransactional(byte journalID, long txID, long id, EncodingSupport record) throws Exception
Exception
public void appendDeleteRecordTransactional(byte journalID, long txID, long id) throws Exception
Exception
public void appendPrepareRecord(byte journalID, long txID, EncodingSupport transactionData) throws Exception
Exception
public void appendRollbackRecord(byte journalID, long txID) throws Exception
Exception
public void pageClosed(SimpleString storeName, int pageNumber)
storeName
- pageNumber
- public void pageDeleted(SimpleString storeName, int pageNumber)
public void pageWrite(PagedMessage message, int pageNumber)
public void largeMessageBegin(long messageId)
public void largeMessageDelete(Long messageId, JournalStorageManager storageManager)
public void largeMessageWrite(long messageId, byte[] body)
public boolean isStarted()
isStarted
in interface ActiveMQComponent
public void start() throws ActiveMQException
start
in interface ActiveMQComponent
ActiveMQException
public void stop() throws Exception
stop
in interface ActiveMQComponent
Exception
public void clearReplicationTokens()
This can be necessary in case the live loses connection to the backup (network failure, or backup crashing).
public Set<OperationContext> getActiveTokens()
public void syncJournalFile(JournalFile jf, AbstractJournalStorageManager.JournalContent content) throws Exception
ActiveMQException
Exception
public void syncLargeMessageFile(SequentialFile file, long size, long id) throws Exception
Exception
public void syncPages(SequentialFile file, long id, SimpleString queueName) throws Exception
Exception
public void sendStartSyncMessage(JournalFile[] datafiles, AbstractJournalStorageManager.JournalContent contentType, String nodeID, boolean allowsAutoFailBack) throws ActiveMQException
datafiles
- contentType
- ActiveMQException
public void sendSynchronizationDone(String nodeID, long initialReplicationSyncTimeout)
So if 'live' fails, the (up-to-date) backup now may take over its duties. To do so, it must
know which is the live's nodeID
.
nodeID
- public void sendLargeMessageIdListMessage(Map<Long,Pair<String,Long>> largeMessages)
Doing this before hand removes the need of synchronizing large-message deletes with the largeMessageSyncList.
largeMessages
- public OperationContext sendLiveIsStopping(ReplicationLiveIsStoppingMessage.LiveStopping finalMessage)
This notification allows the backup to skip quorum voting (or any other measure to avoid 'split-brain') and do a faster fail-over.
public CoreRemotingConnection getBackupTransportConnection()
public boolean isSynchronizing()
Copyright © 2017 JBoss by Red Hat. All rights reserved.