use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalDeleteRecordTX in project activemq-artemis by apache.
the class JournalImpl method appendDeleteRecordTransactional.
@Override
public void appendDeleteRecordTransactional(final long txID, final long id, final EncodingSupport record) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("scheduling appendDeleteRecordTransactional::txID=" + txID + ", id=" + id);
}
checkJournalIsLoaded();
appendExecutor.execute(new Runnable() {
@Override
public void run() {
journalLock.readLock().lock();
final JournalTransaction tx = getTransactionInfo(txID);
try {
if (tx != null) {
tx.checkErrorCondition();
}
JournalInternalRecord deleteRecordTX = new JournalDeleteRecordTX(txID, id, record);
JournalFile usedFile = appendRecord(deleteRecordTX, false, false, tx, null);
if (logger.isTraceEnabled()) {
logger.trace("appendDeleteRecordTransactional::txID=" + txID + ", id=" + id + ", usedFile = " + usedFile);
}
tx.addNegative(usedFile, id);
} catch (Exception e) {
logger.error("appendDeleteRecordTransactional:" + e, e);
setErrorCondition(null, tx, e);
} finally {
journalLock.readLock().unlock();
}
}
});
}
use of org.apache.activemq.artemis.core.journal.impl.dataformat.JournalDeleteRecordTX 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.JournalDeleteRecordTX in project activemq-artemis by apache.
the class JournalCompactor method onReadDeleteRecordTX.
@Override
public void onReadDeleteRecordTX(final long transactionID, final RecordInfo info) throws Exception {
if (logger.isTraceEnabled()) {
logger.trace("onReadDeleteRecordTX " + transactionID + " info " + info);
}
if (pendingTransactions.get(transactionID) != null) {
JournalTransaction newTransaction = getNewJournalTransaction(transactionID);
JournalInternalRecord record = new JournalDeleteRecordTX(transactionID, info.id, new ByteArrayEncoding(info.data));
checkSize(record.getEncodeSize());
writeEncoder(record);
newTransaction.addNegative(currentFile, info.id);
}
// else.. nothing to be done
}
Aggregations