Search in sources :

Example 6 with JournalCompleteRecordTX

use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX in project activemq-artemis by apache.

the class JournalCompactor method onReadPrepareRecord.

@Override
public void onReadPrepareRecord(final long transactionID, final byte[] extraData, final int numberOfRecords) throws Exception {
    if (logger.isTraceEnabled()) {
        logger.trace("onReadPrepareRecord " + transactionID);
    }
    if (pendingTransactions.get(transactionID) != null) {
        JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
        JournalInternalRecord prepareRecord = new JournalCompleteRecordTX(TX_RECORD_TYPE.PREPARE, transactionID, new ByteArrayEncoding(extraData));
        checkSize(prepareRecord.getEncodeSize());
        writeEncoder(prepareRecord, newTransaction.getCounter(currentFile));
        newTransaction.prepare(currentFile);
    }
}
Also used : ByteArrayEncoding(org.apache.activemq.artemis.core.journal.impl.dataformat.ByteArrayEncoding) JournalCompleteRecordTX(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Aggregations

JournalCompleteRecordTX (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX)6 JournalInternalRecord (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)6 IOException (java.io.IOException)1 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)1 ByteArrayEncoding (org.apache.activemq.artemis.core.journal.impl.dataformat.ByteArrayEncoding)1