use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecord in project activemq-artemis by apache.
the class FileWrapperJournal method appendUpdateRecord.
@Override
public void appendUpdateRecord(long id, byte recordType, Persister persister, Object record, boolean sync, IOCompletion callback) throws Exception {
JournalInternalRecord updateRecord = new JournalAddRecord(false, id, recordType, persister, record);
writeRecord(updateRecord, false, -1, false, callback);
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalAddRecord in project activemq-artemis by apache.
the class JournalCompactor method onReadAddRecord.
// JournalReaderCallback implementation -------------------------------------------
@Override
public void onReadAddRecord(final RecordInfo info) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("Read Record " + info);
}
if (lookupRecord(info.id)) {
JournalInternalRecord addRecord = new JournalAddRecord(true, info.id, info.getUserRecordType(), EncoderPersister.getInstance(), new ByteArrayEncoding(info.data));
addRecord.setCompactCount((short) (info.compactCount + 1));
checkSize(addRecord.getEncodeSize(), info.compactCount);
writeEncoder(addRecord);
newRecords.put(info.id, new JournalRecord(currentFile, addRecord.getEncodeSize()));
}
}
Aggregations