Search in sources :

Example 6 with JournalInternalRecord

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);
}
Also used : JournalDeleteRecordTX(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalDeleteRecordTX) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Example 7 with JournalInternalRecord

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);
}
Also used : JournalRollbackRecordTX(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalRollbackRecordTX) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Example 8 with JournalInternalRecord

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);
}
Also used : JournalCompleteRecordTX(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Example 9 with JournalInternalRecord

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);
}
Also used : JournalAddRecordTX(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecordTX) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Example 10 with JournalInternalRecord

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);
    }
}
Also used : JournalAddRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecord) ByteArrayEncoding(org.apache.activemq.artemis.core.journal.impl.dataformat.ByteArrayEncoding) JournalInternalRecord(org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)

Aggregations

JournalInternalRecord (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalInternalRecord)27 ByteArrayEncoding (org.apache.activemq.artemis.core.journal.impl.dataformat.ByteArrayEncoding)7 JournalAddRecord (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecord)7 IOException (java.io.IOException)6 RejectedExecutionException (java.util.concurrent.RejectedExecutionException)6 JournalAddRecordTX (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecordTX)6 JournalCompleteRecordTX (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalCompleteRecordTX)6 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 JournalDeleteRecordTX (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalDeleteRecordTX)3 JournalRollbackRecordTX (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalRollbackRecordTX)3 JournalDeleteRecord (org.apache.activemq.artemis.core.journal.impl.dataformat.JournalDeleteRecord)2 ByteBuffer (java.nio.ByteBuffer)1 ActiveMQBuffer (org.apache.activemq.artemis.api.core.ActiveMQBuffer)1 SequentialFile (org.apache.activemq.artemis.core.io.SequentialFile)1