Class JDBCJournalImpl
- java.lang.Object
-
- org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver
-
- org.apache.activemq.artemis.jdbc.store.journal.JDBCJournalImpl
-
- All Implemented Interfaces:
Journal,ActiveMQComponent
public class JDBCJournalImpl extends AbstractJDBCDriver implements Journal
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.activemq.artemis.core.journal.Journal
Journal.JournalState
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver
connectionProvider, sqlProvider
-
-
Constructor Summary
Constructors Constructor Description JDBCJournalImpl(JDBCConnectionProvider connectionProvider, SQLProvider provider, ScheduledExecutorService scheduledExecutorService, Executor completeExecutor, IOCriticalErrorListener criticalIOErrorListener, long syncDelay)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendAddEvent(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback)voidappendAddRecord(long id, byte recordType, byte[] record, boolean sync)voidappendAddRecord(long id, byte recordType, Persister persister, Object record, boolean sync)voidappendAddRecord(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback)voidappendAddRecordTransactional(long txID, long id, byte recordType, byte[] record)voidappendAddRecordTransactional(long txID, long id, byte recordType, Persister persister, Object record)voidappendCommitRecord(long txID, boolean sync)voidappendCommitRecord(long txID, boolean sync, IOCompletion callback)voidappendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext)voidappendDeleteRecord(long id, boolean sync)voidappendDeleteRecord(long id, boolean sync, IOCompletion completionCallback)voidappendDeleteRecordTransactional(long txID, long id)voidappendDeleteRecordTransactional(long txID, long id, byte[] record)voidappendDeleteRecordTransactional(long txID, long id, EncodingSupport record)voidappendPrepareRecord(long txID, byte[] transactionData, boolean sync)voidappendPrepareRecord(long txID, EncodingSupport transactionData, boolean sync)voidappendPrepareRecord(long txID, EncodingSupport transactionData, boolean sync, IOCompletion callback)voidappendRollbackRecord(long txID, boolean sync)voidappendRollbackRecord(long txID, boolean sync, IOCompletion callback)voidappendUpdateRecord(long id, byte recordType, byte[] record, boolean sync)voidappendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync)voidappendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback)voidappendUpdateRecordTransactional(long txID, long id, byte recordType, byte[] record)voidappendUpdateRecordTransactional(long txID, long id, byte recordType, Persister persister, Object record)Map<Long,JournalFile>createFilesForBackupSync(long[] fileIds)protected voidcreateSchema()voiddestroy()voidflush()voidforceMoveNextFile()intgetAlignment()JournalFile[]getDataFiles()SequentialFileFactorygetFileFactory()intgetFileSize()longgetMaxRecordSize()The max size record that can be stored in the journalintgetNumberOfRecords()intgetUserVersion()voidhandleException(List<org.apache.activemq.artemis.jdbc.store.journal.JDBCJournalRecord> recordRef, Throwable e)public for tests only, not through APIbooleanisRemoveExtraFilesOnLoad()booleanisStarted()voidlineUpContext(IOCompletion callback)JournalLoadInformationload(List<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback failureCallback, boolean fixBadTX)JournalLoadInformationload(LoaderCallback reloadManager)JournalLoadInformationload(SparseArrayLinkedList<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback failureCallback, boolean fixBadTX)JournalLoadInformationloadInternalOnly()JournalLoadInformationloadSyncOnly(Journal.JournalState state)protected voidprepareStatements()voidreplicationSyncFinished()voidreplicationSyncPreserveOldFiles()voidscheduleCompactAndBlock(int timeout)voidsetRemoveExtraFilesOnLoad(boolean removeExtraFilesOnLoad)voidstart()voidstop()voidstop(boolean sync)intsync()voidsynchronizationLock()voidsynchronizationUnlock()voidtryAppendDeleteRecord(long id, boolean sync, JournalUpdateCallback updateCallback, IOCompletion completionCallback)voidtryAppendDeleteRecord(long id, JournalUpdateCallback updateCallback, boolean sync)voidtryAppendUpdateRecord(long id, byte recordType, byte[] record, JournalUpdateCallback updateCallback, boolean sync, boolean replaceableRecord)voidtryAppendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync, boolean replaceableUpdate, JournalUpdateCallback updateCallback, IOCompletion completionCallback)voidtryAppendUpdateRecord(long id, byte recordType, Persister persister, Object record, JournalUpdateCallback updateCallback, boolean sync, boolean replaceableUpdate)-
Methods inherited from class org.apache.activemq.artemis.jdbc.store.drivers.AbstractJDBCDriver
createTable, getJdbcConnectionProvider, setJdbcConnectionProvider, setSqlProvider
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.core.server.ActiveMQComponent
asyncStop
-
Methods inherited from interface org.apache.activemq.artemis.core.journal.Journal
appendAddRecord, appendAddRecord, appendAddRecordTransactional, appendUpdateRecord, appendUpdateRecord, appendUpdateRecordTransactional, forceBackup, getCriticalErrorListener, isHistory, load, load, processBackup, processBackupCleanup, replaceableRecord, setCriticalErrorListener, setHistoryFolder, tryAppendUpdateRecord, tryAppendUpdateRecord
-
-
-
-
Constructor Detail
-
JDBCJournalImpl
public JDBCJournalImpl(JDBCConnectionProvider connectionProvider, SQLProvider provider, ScheduledExecutorService scheduledExecutorService, Executor completeExecutor, IOCriticalErrorListener criticalIOErrorListener, long syncDelay)
-
-
Method Detail
-
setRemoveExtraFilesOnLoad
public void setRemoveExtraFilesOnLoad(boolean removeExtraFilesOnLoad)
- Specified by:
setRemoveExtraFilesOnLoadin interfaceJournal
-
isRemoveExtraFilesOnLoad
public boolean isRemoveExtraFilesOnLoad()
- Specified by:
isRemoveExtraFilesOnLoadin interfaceJournal
-
appendAddEvent
public void appendAddEvent(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback) throws Exception- Specified by:
appendAddEventin interfaceJournal- Throws:
Exception
-
start
public void start() throws SQLException- Specified by:
startin interfaceActiveMQComponent- Overrides:
startin classAbstractJDBCDriver- Throws:
SQLException
-
flush
public void flush() throws Exception
-
getMaxRecordSize
public long getMaxRecordSize()
The max size record that can be stored in the journal- Specified by:
getMaxRecordSizein interfaceJournal- Returns:
-
createSchema
protected void createSchema() throws SQLException- Specified by:
createSchemain classAbstractJDBCDriver- Throws:
SQLException
-
prepareStatements
protected void prepareStatements()
- Specified by:
prepareStatementsin classAbstractJDBCDriver
-
stop
public void stop() throws SQLException- Specified by:
stopin interfaceActiveMQComponent- Overrides:
stopin classAbstractJDBCDriver- Throws:
SQLException
-
stop
public void stop(boolean sync) throws SQLException- Throws:
SQLException
-
destroy
public void destroy() throws Exception- Overrides:
destroyin classAbstractJDBCDriver- Throws:
Exception
-
sync
public int sync()
-
handleException
public void handleException(List<org.apache.activemq.artemis.jdbc.store.journal.JDBCJournalRecord> recordRef, Throwable e)
public for tests only, not through API
-
appendAddRecord
public void appendAddRecord(long id, byte recordType, byte[] record, boolean sync) throws Exception- Specified by:
appendAddRecordin interfaceJournal- Throws:
Exception
-
appendAddRecord
public void appendAddRecord(long id, byte recordType, Persister persister, Object record, boolean sync) throws Exception- Specified by:
appendAddRecordin interfaceJournal- Throws:
Exception
-
appendAddRecord
public void appendAddRecord(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback) throws Exception- Specified by:
appendAddRecordin interfaceJournal- Throws:
Exception
-
appendUpdateRecord
public void appendUpdateRecord(long id, byte recordType, byte[] record, boolean sync) throws Exception- Specified by:
appendUpdateRecordin interfaceJournal- Throws:
Exception
-
tryAppendUpdateRecord
public void tryAppendUpdateRecord(long id, byte recordType, byte[] record, JournalUpdateCallback updateCallback, boolean sync, boolean replaceableRecord) throws Exception- Specified by:
tryAppendUpdateRecordin interfaceJournal- Throws:
Exception
-
appendUpdateRecord
public void appendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync) throws Exception- Specified by:
appendUpdateRecordin interfaceJournal- Throws:
Exception
-
tryAppendUpdateRecord
public void tryAppendUpdateRecord(long id, byte recordType, Persister persister, Object record, JournalUpdateCallback updateCallback, boolean sync, boolean replaceableUpdate) throws Exception- Specified by:
tryAppendUpdateRecordin interfaceJournal- Throws:
Exception
-
appendUpdateRecord
public void appendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion completionCallback) throws Exception- Specified by:
appendUpdateRecordin interfaceJournal- Throws:
Exception
-
tryAppendUpdateRecord
public void tryAppendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync, boolean replaceableUpdate, JournalUpdateCallback updateCallback, IOCompletion completionCallback) throws Exception- Specified by:
tryAppendUpdateRecordin interfaceJournal- Throws:
Exception
-
appendDeleteRecord
public void appendDeleteRecord(long id, boolean sync) throws Exception- Specified by:
appendDeleteRecordin interfaceJournal- Throws:
Exception
-
tryAppendDeleteRecord
public void tryAppendDeleteRecord(long id, JournalUpdateCallback updateCallback, boolean sync) throws Exception- Specified by:
tryAppendDeleteRecordin interfaceJournal- Throws:
Exception
-
appendDeleteRecord
public void appendDeleteRecord(long id, boolean sync, IOCompletion completionCallback) throws Exception- Specified by:
appendDeleteRecordin interfaceJournal- Throws:
Exception
-
tryAppendDeleteRecord
public void tryAppendDeleteRecord(long id, boolean sync, JournalUpdateCallback updateCallback, IOCompletion completionCallback) throws Exception- Specified by:
tryAppendDeleteRecordin interfaceJournal- Throws:
Exception
-
appendAddRecordTransactional
public void appendAddRecordTransactional(long txID, long id, byte recordType, byte[] record) throws Exception- Specified by:
appendAddRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendAddRecordTransactional
public void appendAddRecordTransactional(long txID, long id, byte recordType, Persister persister, Object record) throws Exception- Specified by:
appendAddRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendUpdateRecordTransactional
public void appendUpdateRecordTransactional(long txID, long id, byte recordType, byte[] record) throws Exception- Specified by:
appendUpdateRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendUpdateRecordTransactional
public void appendUpdateRecordTransactional(long txID, long id, byte recordType, Persister persister, Object record) throws Exception- Specified by:
appendUpdateRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendDeleteRecordTransactional
public void appendDeleteRecordTransactional(long txID, long id, byte[] record) throws Exception- Specified by:
appendDeleteRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendDeleteRecordTransactional
public void appendDeleteRecordTransactional(long txID, long id, EncodingSupport record) throws Exception- Specified by:
appendDeleteRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendDeleteRecordTransactional
public void appendDeleteRecordTransactional(long txID, long id) throws Exception- Specified by:
appendDeleteRecordTransactionalin interfaceJournal- Throws:
Exception
-
appendCommitRecord
public void appendCommitRecord(long txID, boolean sync) throws Exception- Specified by:
appendCommitRecordin interfaceJournal- Throws:
Exception
-
appendCommitRecord
public void appendCommitRecord(long txID, boolean sync, IOCompletion callback) throws Exception- Specified by:
appendCommitRecordin interfaceJournal- Throws:
Exception
-
appendCommitRecord
public void appendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception- Specified by:
appendCommitRecordin interfaceJournal- Throws:
Exception
-
appendPrepareRecord
public void appendPrepareRecord(long txID, EncodingSupport transactionData, boolean sync) throws Exception- Specified by:
appendPrepareRecordin interfaceJournal- Throws:
Exception
-
appendPrepareRecord
public void appendPrepareRecord(long txID, EncodingSupport transactionData, boolean sync, IOCompletion callback) throws Exception- Specified by:
appendPrepareRecordin interfaceJournal- Throws:
Exception
-
appendPrepareRecord
public void appendPrepareRecord(long txID, byte[] transactionData, boolean sync) throws Exception- Specified by:
appendPrepareRecordin interfaceJournal- Throws:
Exception
-
appendRollbackRecord
public void appendRollbackRecord(long txID, boolean sync) throws Exception- Specified by:
appendRollbackRecordin interfaceJournal- Throws:
Exception
-
appendRollbackRecord
public void appendRollbackRecord(long txID, boolean sync, IOCompletion callback) throws Exception- Specified by:
appendRollbackRecordin interfaceJournal- Throws:
Exception
-
load
public JournalLoadInformation load(LoaderCallback reloadManager)
-
loadInternalOnly
public JournalLoadInformation loadInternalOnly() throws Exception
- Specified by:
loadInternalOnlyin interfaceJournal- Throws:
Exception
-
loadSyncOnly
public JournalLoadInformation loadSyncOnly(Journal.JournalState state) throws Exception
- Specified by:
loadSyncOnlyin interfaceJournal- Throws:
Exception
-
lineUpContext
public void lineUpContext(IOCompletion callback)
- Specified by:
lineUpContextin interfaceJournal
-
load
public JournalLoadInformation load(SparseArrayLinkedList<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback failureCallback, boolean fixBadTX) throws Exception
-
load
public JournalLoadInformation load(List<RecordInfo> committedRecords, List<PreparedTransactionInfo> preparedTransactions, TransactionFailureCallback failureCallback, boolean fixBadTX) throws Exception
-
getAlignment
public int getAlignment() throws Exception- Specified by:
getAlignmentin interfaceJournal- Throws:
Exception
-
getNumberOfRecords
public int getNumberOfRecords()
- Specified by:
getNumberOfRecordsin interfaceJournal
-
getUserVersion
public int getUserVersion()
- Specified by:
getUserVersionin interfaceJournal
-
createFilesForBackupSync
public Map<Long,JournalFile> createFilesForBackupSync(long[] fileIds) throws Exception
- Specified by:
createFilesForBackupSyncin interfaceJournal- Throws:
Exception
-
synchronizationLock
public final void synchronizationLock()
- Specified by:
synchronizationLockin interfaceJournal
-
synchronizationUnlock
public final void synchronizationUnlock()
- Specified by:
synchronizationUnlockin interfaceJournal
-
forceMoveNextFile
public void forceMoveNextFile() throws Exception- Specified by:
forceMoveNextFilein interfaceJournal- Throws:
Exception
-
getDataFiles
public JournalFile[] getDataFiles()
- Specified by:
getDataFilesin interfaceJournal
-
getFileFactory
public SequentialFileFactory getFileFactory()
- Specified by:
getFileFactoryin interfaceJournal
-
getFileSize
public int getFileSize()
- Specified by:
getFileSizein interfaceJournal
-
scheduleCompactAndBlock
public void scheduleCompactAndBlock(int timeout) throws Exception- Specified by:
scheduleCompactAndBlockin interfaceJournal- Throws:
Exception
-
replicationSyncPreserveOldFiles
public void replicationSyncPreserveOldFiles()
- Specified by:
replicationSyncPreserveOldFilesin interfaceJournal
-
replicationSyncFinished
public void replicationSyncFinished()
- Specified by:
replicationSyncFinishedin interfaceJournal
-
isStarted
public boolean isStarted()
- Specified by:
isStartedin interfaceActiveMQComponent
-
-