use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord in project activemq-artemis by apache.
the class FileWrapperJournal method appendDeleteRecordTransactional.
@Override
public void appendDeleteRecordTransactional(long txID, long id, EncodingSupport record) throws Exception {
JournalInternalRecord deleteRecordTX = new JournalDeleteRecordTX(txID, id, record);
writeRecord(deleteRecordTX, false, txID, false, null);
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord in project activemq-artemis by apache.
the class FileWrapperJournal method appendRollbackRecord.
@Override
public void appendRollbackRecord(long txID, boolean sync, IOCompletion callback) throws Exception {
JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(txID);
writeRecord(rollbackRecord, true, txID, true, callback);
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord in project activemq-artemis by apache.
the class FileWrapperJournal method appendCommitRecord.
@Override
public void appendCommitRecord(long txID, boolean sync, IOCompletion callback, boolean lineUpContext) throws Exception {
JournalInternalRecord commitRecord = new JournalCompleteRecordTX(TX_RECORD_TYPE.COMMIT, txID, null);
writeRecord(commitRecord, true, txID, true, callback);
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord in project activemq-artemis by apache.
the class FileWrapperJournal method appendAddRecordTransactional.
@Override
public void appendAddRecordTransactional(long txID, long id, byte recordType, Persister persister, Object record) throws Exception {
JournalInternalRecord addRecord = new JournalAddRecordTX(true, txID, id, recordType, persister, record);
writeRecord(addRecord, false, txID, false, null);
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord in project activemq-artemis by apache.
the class JournalCompactor method onReadUpdateRecord.
@Override
public void onReadUpdateRecord(final RecordInfo info) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("onReadUpdateRecord " + info);
}
if (lookupRecord(info.id)) {
JournalInternalRecord updateRecord = new JournalAddRecord(false, info.id, info.userRecordType, EncoderPersister.getInstance(), new ByteArrayEncoding(info.data));
updateRecord.setCompactCount((short) (info.compactCount + 1));
checkSize(updateRecord.getEncodeSize(), info.compactCount);
JournalRecord newRecord = newRecords.get(info.id);
if (newRecord == null) {
ActiveMQJournalLogger.LOGGER.compactingWithNoAddRecord(info.id);
} else {
newRecord.addUpdateFile(currentFile, updateRecord.getEncodeSize());
}
writeEncoder(updateRecord);
}
}
Aggregations