public interface Journal extends ActiveMQComponent
Notice also that even on the callback methods it's possible to pass the sync mode. That will only make sense on the NIO operations.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Journal.JournalState |
| Modifier and Type | Method and Description |
|---|---|
void |
appendAddRecord(long id,
byte recordType,
byte[] record,
boolean sync) |
default void |
appendAddRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync) |
default void |
appendAddRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback) |
void |
appendAddRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync) |
void |
appendAddRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion completionCallback) |
void |
appendAddRecordTransactional(long txID,
long id,
byte recordType,
byte[] record) |
default void |
appendAddRecordTransactional(long txID,
long id,
byte recordType,
EncodingSupport record) |
void |
appendAddRecordTransactional(long txID,
long id,
byte recordType,
Persister persister,
Object record) |
void |
appendCommitRecord(long txID,
boolean sync) |
void |
appendCommitRecord(long txID,
boolean sync,
IOCompletion callback) |
void |
appendCommitRecord(long txID,
boolean sync,
IOCompletion callback,
boolean lineUpContext) |
void |
appendDeleteRecord(long id,
boolean sync) |
void |
appendDeleteRecord(long id,
boolean sync,
IOCompletion completionCallback) |
void |
appendDeleteRecordTransactional(long txID,
long id) |
void |
appendDeleteRecordTransactional(long txID,
long id,
byte[] record) |
void |
appendDeleteRecordTransactional(long txID,
long id,
EncodingSupport record) |
void |
appendPrepareRecord(long txID,
byte[] transactionData,
boolean sync) |
void |
appendPrepareRecord(long txID,
EncodingSupport transactionData,
boolean sync)
If the system crashed after a prepare was called, it should store information that is required to bring the transaction
back to a state it could be committed.
|
void |
appendPrepareRecord(long txID,
EncodingSupport transactionData,
boolean sync,
IOCompletion callback) |
void |
appendRollbackRecord(long txID,
boolean sync) |
void |
appendRollbackRecord(long txID,
boolean sync,
IOCompletion callback) |
void |
appendUpdateRecord(long id,
byte recordType,
byte[] record,
boolean sync) |
default void |
appendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync) |
default void |
appendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback) |
void |
appendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync) |
void |
appendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion callback) |
void |
appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
byte[] record) |
default void |
appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
EncodingSupport record) |
void |
appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
Persister persister,
Object record) |
Map<Long,JournalFile> |
createFilesForBackupSync(long[] fileIds)
Reserves journal file IDs, creates the necessary files for synchronization, and places
references to these (reserved for sync) files in the map.
|
void |
flush()
It will make sure there are no more pending operations on the Executors.
|
void |
forceMoveNextFile()
Force the usage of a new
JournalFile. |
int |
getAlignment() |
JournalFile[] |
getDataFiles()
Returns the
JournalFiles in use. |
SequentialFileFactory |
getFileFactory() |
int |
getFileSize() |
long |
getMaxRecordSize()
The max size record that can be stored in the journal
|
int |
getNumberOfRecords() |
int |
getUserVersion() |
boolean |
isRemoveExtraFilesOnLoad() |
void |
lineUpContext(IOCompletion callback) |
default JournalLoadInformation |
load(List<RecordInfo> committedRecords,
List<PreparedTransactionInfo> preparedTransactions,
TransactionFailureCallback transactionFailure) |
JournalLoadInformation |
load(List<RecordInfo> committedRecords,
List<PreparedTransactionInfo> preparedTransactions,
TransactionFailureCallback transactionFailure,
boolean fixBadTx) |
JournalLoadInformation |
load(LoaderCallback reloadManager) |
default JournalLoadInformation |
load(SparseArrayLinkedList<RecordInfo> committedRecords,
List<PreparedTransactionInfo> preparedTransactions,
TransactionFailureCallback transactionFailure) |
JournalLoadInformation |
load(SparseArrayLinkedList<RecordInfo> committedRecords,
List<PreparedTransactionInfo> preparedTransactions,
TransactionFailureCallback transactionFailure,
boolean fixBadTx) |
JournalLoadInformation |
loadInternalOnly()
Load internal data structures and not expose any data.
|
JournalLoadInformation |
loadSyncOnly(Journal.JournalState state)
Load internal data structures, and remain waiting for synchronization to complete.
|
default void |
replaceableRecord(byte recordType) |
void |
replicationSyncFinished()
Restarts file reclaim and compacting on the journal.
|
void |
replicationSyncPreserveOldFiles()
Stops any operation that may delete or modify old (stale) data.
|
void |
runDirectJournalBlast() |
void |
scheduleCompactAndBlock(int timeout)
This method will start compact using the compactorExecutor and block up to timeout seconds
|
void |
setRemoveExtraFilesOnLoad(boolean removeExtraFilesOnLoad) |
void |
synchronizationLock()
Write lock the Journal and write lock the compacting process.
|
void |
synchronizationUnlock()
Unlock the Journal and the compacting process.
|
boolean |
tryAppendDeleteRecord(long id,
boolean sync) |
boolean |
tryAppendDeleteRecord(long id,
boolean sync,
IOCompletion completionCallback) |
boolean |
tryAppendUpdateRecord(long id,
byte recordType,
byte[] record,
boolean sync) |
default boolean |
tryAppendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync) |
default boolean |
tryAppendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback) |
boolean |
tryAppendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync) |
boolean |
tryAppendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion callback) |
asyncStop, isStarted, start, stopvoid setRemoveExtraFilesOnLoad(boolean removeExtraFilesOnLoad)
boolean isRemoveExtraFilesOnLoad()
void appendAddRecord(long id,
byte recordType,
byte[] record,
boolean sync)
throws Exception
Exceptiondefault void appendAddRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync)
throws Exception
Exceptionvoid appendAddRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync)
throws Exception
Exceptionvoid appendAddRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptiondefault void appendAddRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptiondefault void replaceableRecord(byte recordType)
void appendUpdateRecord(long id,
byte recordType,
byte[] record,
boolean sync)
throws Exception
Exceptionboolean tryAppendUpdateRecord(long id,
byte recordType,
byte[] record,
boolean sync)
throws Exception
Exceptiondefault void appendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync)
throws Exception
Exceptiondefault boolean tryAppendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync)
throws Exception
Exceptionvoid appendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync)
throws Exception
Exceptionboolean tryAppendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync)
throws Exception
Exceptiondefault void appendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptiondefault boolean tryAppendUpdateRecord(long id,
byte recordType,
EncodingSupport record,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptionvoid appendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion callback)
throws Exception
Exceptionboolean tryAppendUpdateRecord(long id,
byte recordType,
Persister persister,
Object record,
boolean sync,
IOCompletion callback)
throws Exception
Exceptionvoid appendDeleteRecord(long id,
boolean sync)
throws Exception
Exceptionboolean tryAppendDeleteRecord(long id,
boolean sync)
throws Exception
Exceptionvoid appendDeleteRecord(long id,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptionboolean tryAppendDeleteRecord(long id,
boolean sync,
IOCompletion completionCallback)
throws Exception
Exceptionvoid appendAddRecordTransactional(long txID,
long id,
byte recordType,
byte[] record)
throws Exception
Exceptiondefault void appendAddRecordTransactional(long txID,
long id,
byte recordType,
EncodingSupport record)
throws Exception
Exceptionvoid appendAddRecordTransactional(long txID,
long id,
byte recordType,
Persister persister,
Object record)
throws Exception
Exceptionvoid appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
byte[] record)
throws Exception
Exceptiondefault void appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
EncodingSupport record)
throws Exception
Exceptionvoid appendUpdateRecordTransactional(long txID,
long id,
byte recordType,
Persister persister,
Object record)
throws Exception
Exceptionvoid appendDeleteRecordTransactional(long txID,
long id,
byte[] record)
throws Exception
Exceptionvoid appendDeleteRecordTransactional(long txID,
long id,
EncodingSupport record)
throws Exception
Exceptionvoid appendDeleteRecordTransactional(long txID,
long id)
throws Exception
Exceptionvoid appendCommitRecord(long txID,
boolean sync)
throws Exception
Exceptionvoid appendCommitRecord(long txID,
boolean sync,
IOCompletion callback)
throws Exception
Exceptionvoid appendCommitRecord(long txID,
boolean sync,
IOCompletion callback,
boolean lineUpContext)
throws Exception
txID - sync - callback - lineUpContext - if appendCommitRecord should call a storeLineUp. This is because the
caller may have already taken into accountExceptionvoid appendPrepareRecord(long txID,
EncodingSupport transactionData,
boolean sync)
throws Exception
If the system crashed after a prepare was called, it should store information that is required to bring the transaction back to a state it could be committed.
transactionData allows you to store any other supporting user-data related to the transaction
txID - transactionData - - extra user data for the prepareExceptionvoid appendPrepareRecord(long txID,
EncodingSupport transactionData,
boolean sync,
IOCompletion callback)
throws Exception
Exceptionvoid appendPrepareRecord(long txID,
byte[] transactionData,
boolean sync)
throws Exception
Exceptionvoid appendRollbackRecord(long txID,
boolean sync)
throws Exception
Exceptionvoid appendRollbackRecord(long txID,
boolean sync,
IOCompletion callback)
throws Exception
ExceptionJournalLoadInformation load(LoaderCallback reloadManager) throws Exception
ExceptionJournalLoadInformation loadInternalOnly() throws Exception
ExceptionJournalLoadInformation loadSyncOnly(Journal.JournalState state) throws Exception
state - the current state of the journal, this parameter ensures consistency.Exceptionvoid lineUpContext(IOCompletion callback)
default JournalLoadInformation load(List<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback transactionFailure) throws Exception
ExceptionJournalLoadInformation load(List<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback transactionFailure, boolean fixBadTx) throws Exception
Exceptiondefault JournalLoadInformation load(SparseArrayLinkedList<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback transactionFailure) throws Exception
ExceptionJournalLoadInformation load(SparseArrayLinkedList<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback transactionFailure, boolean fixBadTx) throws Exception
Exceptionint getNumberOfRecords()
int getUserVersion()
Map<Long,JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception
During the synchronization between a live server and backup, we reserve in the backup the journal file IDs used in the live server. This call also makes sure the files are created empty without any kind of headers added.
fileIds - IDs to reserve for synchronizationExceptionvoid synchronizationLock()
void synchronizationUnlock()
synchronizationLock()void forceMoveNextFile()
throws Exception
JournalFile.ExceptionJournalFile[] getDataFiles()
JournalFiles in use.JournalFiles in useSequentialFileFactory getFileFactory()
int getFileSize()
void scheduleCompactAndBlock(int timeout)
throws Exception
timeout - the timeout in seconds or block forever if <= 0Exceptionvoid replicationSyncPreserveOldFiles()
Meant to be used during synchronization of data between a live server and its replicating (remote) backup. Old files must not be compacted or deleted during synchronization.
void replicationSyncFinished()
Meant to be used to revert the effect of replicationSyncPreserveOldFiles(). it should
only be called once the synchronization of the backup and live servers is completed.
void flush()
throws Exception
Exceptionlong getMaxRecordSize()
Copyright © 2021 JBoss by Red Hat. All rights reserved.