@Override public void onReadRollbackRecord(final long transactionID) throws Exception { TransactionHolder tx = loadTransactions.remove(transactionID); // The rollback could be alone on its own journal-file and the // whole transaction body was reclaimed but the commit-record // So it is completely legal to not find a transaction at this // point if (tx != null) { JournalTransaction tnp = transactions.remove(transactionID); if (tnp == null) { throw new IllegalStateException("Cannot find tx " + transactionID); } // There is no need to validate summaries/holes on // Rollbacks.. We will ignore the data anyway. tnp.rollback(file); hasData.lazySet(true); } }
@Override public void onReadRollbackRecord(final long transactionID) throws Exception { TransactionHolder tx = loadTransactions.remove(transactionID); // The rollback could be alone on its own journal-file and the // whole transaction body was reclaimed but the commit-record // So it is completely legal to not find a transaction at this // point if (tx != null) { JournalTransaction tnp = transactions.remove(transactionID); if (tnp == null) { throw new IllegalStateException("Cannot find tx " + transactionID); } // There is no need to validate summaries/holes on // Rollbacks.. We will ignore the data anyway. tnp.rollback(file); hasData.lazySet(true); } }
@Override public void run() { journalLock.readLock().lock(); final JournalTransaction tx = transactions.remove(txID); try { if (logger.isTraceEnabled()) { logger.trace("appendRollbackRecord::txID=" + txID ); } if (tx == null) { throw new IllegalStateException("Cannot find tx with id " + txID); } JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(txID); JournalFile usedFile = appendRecord(rollbackRecord, false, sync, tx, callback); tx.rollback(usedFile); } catch (ActiveMQShutdownException e) { result.fail(e); logger.error("appendRollbackRecord:" + e, e); } catch (Throwable e) { result.fail(e); logger.error("appendRollbackRecord:" + e, e); setErrorCondition(callback, tx, e); } finally { journalLock.readLock().unlock(); result.set(tx); } } });
@Override public void run() { journalLock.readLock().lock(); final JournalTransaction tx = transactions.remove(txID); try { if (logger.isTraceEnabled()) { logger.trace("appendRollbackRecord::txID=" + txID ); } if (tx == null) { throw new IllegalStateException("Cannot find tx with id " + txID); } JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(txID); JournalFile usedFile = appendRecord(rollbackRecord, false, sync, tx, callback); tx.rollback(usedFile); } catch (ActiveMQShutdownException e) { result.fail(e); logger.error("appendRollbackRecord:" + e, e); } catch (Throwable e) { result.fail(e); logger.error("appendRollbackRecord:" + e, e); setErrorCondition(callback, tx, e); } finally { journalLock.readLock().unlock(); result.set(tx); } } });
@Override public void onReadRollbackRecord(final long transactionID) throws Exception { if (logger.isTraceEnabled()) { logger.trace("onReadRollbackRecord " + transactionID); } if (pendingTransactions.get(transactionID) != null) { // Sanity check, this should never happen throw new IllegalStateException("Inconsistency during compacting: RollbackRecord ID = " + transactionID + " for an already rolled back transaction during compacting"); } else { JournalTransaction newTransaction = newTransactions.remove(transactionID); if (newTransaction != null) { JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(transactionID); checkSize(rollbackRecord.getEncodeSize()); writeEncoder(rollbackRecord); newTransaction.rollback(currentFile); } } }
@Override public void onReadRollbackRecord(final long transactionID) throws Exception { if (logger.isTraceEnabled()) { logger.trace("onReadRollbackRecord " + transactionID); } if (pendingTransactions.get(transactionID) != null) { // Sanity check, this should never happen throw new IllegalStateException("Inconsistency during compacting: RollbackRecord ID = " + transactionID + " for an already rolled back transaction during compacting"); } else { JournalTransaction newTransaction = newTransactions.remove(transactionID); if (newTransaction != null) { JournalInternalRecord rollbackRecord = new JournalRollbackRecordTX(transactionID); checkSize(rollbackRecord.getEncodeSize()); writeEncoder(rollbackRecord); newTransaction.rollback(currentFile); } } }
@Override void execute() throws Exception { JournalTransaction newTransaction = newTransactions.get(liveTransaction.getId()); if (newTransaction != null) { liveTransaction.merge(newTransaction); liveTransaction.rollback(rollbackFile); } newTransactions.remove(liveTransaction.getId()); }
@Override void execute() throws Exception { JournalTransaction newTransaction = newTransactions.get(liveTransaction.getId()); if (newTransaction != null) { liveTransaction.merge(newTransaction); liveTransaction.rollback(rollbackFile); } newTransactions.remove(liveTransaction.getId()); }