/** * Extended to cancel any running or queued tasks on the {@link WriteExecutorService}. * * @see <a href="http://trac.blazegraph.com/ticket/753" > HA doLocalAbort() * should interrupt NSS requests and AbstractTasks </a> */ @Override public void abortAllTx() { super.abortAllTx(); concurrencyManager.abortAllTx(); }
@Override protected void activateTx(final TxState state) { if (txLog.isInfoEnabled()) txLog.info("OPEN : txId=" + state.tx + ", readsOnCommitTime=" + state.getReadsOnCommitTime()); final IBufferStrategy bufferStrategy = Journal.this.getBufferStrategy(); if (bufferStrategy instanceof IHistoryManager) { final IRawTx tx = ((IHistoryManager)bufferStrategy).newTx(); if (m_rawTxs.put(state.tx, tx) != null) { throw new IllegalStateException( "Unexpected existing RawTx"); } } super.activateTx(state); }
@Override protected void deactivateTx(final TxState state) { if (txLog.isInfoEnabled()) txLog.info("CLOSE: txId=" + state.tx + ", readsOnCommitTime=" + state.getReadsOnCommitTime()); /* * Note: We need to deactivate the tx before RawTx.close() is * invoked otherwise the activeTxCount will never be zero inside * of RawTx.close() and the session protection mode of the * RWStore will never be able to release storage. */ super.deactivateTx(state); final IRawTx tx = m_rawTxs.remove(state.tx); if (tx != null) { tx.close(); } }
/** * Extended to shutdown the embedded transaction service. */ @Override public void shutdownNow() { ((JournalTransactionService) getTransactionService()) .shutdownNow(); super.shutdownNow(); }
/** * Extended to shutdown the embedded transaction service. */ @Override public void shutdown() { ((JournalTransactionService) getTransactionService()) .shutdown(); super.shutdown(); }
@Override public long commit(final long tx) { final TxState state = getTxState(tx); final Quorum<HAGlue, QuorumService<HAGlue>> quorum = getQuorum(); if (quorum != null && state != null && !state.isReadOnly()) { /* * Commit on write transaction. We must be the quorum leader. */ final long token = getQuorumToken(); getQuorum().assertLeader(token); } return super.commit(tx); }
/** * {@inheritDoc} * <p> * Overridden to take the necessary lock since we are invoking this * method from contexts in which the lock would not otherwise be held. * <p> * Note: This is also used to callback on service join to set the * consensus release time from the leader of a newly joined follower. * This ensures that live joiners need not take part in a gather and can * still confidently join in an HA 2 phase commit. * * @param newReleaseTime * The new release time for the local journal. */ @Override public void setReleaseTime(final long newValue) { if (newValue < 0) throw new IllegalArgumentException(); lock.lock(); try { super.setReleaseTime(newValue); } finally { lock.unlock(); } }
abstractTransactionService.start();
return super.newTx(timestamp);
ts.getReleaseTime(), -1);
/** * Extended to shutdown the embedded transaction service. */ @Override public void shutdownNow() { ((JournalTransactionService) getTransactionService()) .shutdownNow(); super.shutdownNow(); }
/** * Extended to shutdown the embedded transaction service. */ @Override public void shutdown() { ((JournalTransactionService) getTransactionService()) .shutdown(); super.shutdown(); }
@Override public long commit(final long tx) { final TxState state = getTxState(tx); final Quorum<HAGlue, QuorumService<HAGlue>> quorum = getQuorum(); if (quorum != null && state != null && !state.isReadOnly()) { /* * Commit on write transaction. We must be the quorum leader. */ final long token = getQuorumToken(); getQuorum().assertLeader(token); } return super.commit(tx); }
/** * {@inheritDoc} * <p> * Overridden to take the necessary lock since we are invoking this * method from contexts in which the lock would not otherwise be held. * <p> * Note: This is also used to callback on service join to set the * consensus release time from the leader of a newly joined follower. * This ensures that live joiners need not take part in a gather and can * still confidently join in an HA 2 phase commit. * * @param newReleaseTime * The new release time for the local journal. */ @Override public void setReleaseTime(final long newValue) { if (newValue < 0) throw new IllegalArgumentException(); lock.lock(); try { super.setReleaseTime(newValue); } finally { lock.unlock(); } }
abstractTransactionService.start();
return super.newTx(timestamp);
/** * Extended to cancel any running or queued tasks on the {@link WriteExecutorService}. * * @see <a href="http://trac.blazegraph.com/ticket/753" > HA doLocalAbort() * should interrupt NSS requests and AbstractTasks </a> */ @Override public void abortAllTx() { super.abortAllTx(); concurrencyManager.abortAllTx(); }
@Override protected void activateTx(final TxState state) { if (txLog.isInfoEnabled()) txLog.info("OPEN : txId=" + state.tx + ", readsOnCommitTime=" + state.getReadsOnCommitTime()); final IBufferStrategy bufferStrategy = Journal.this.getBufferStrategy(); if (bufferStrategy instanceof IHistoryManager) { final IRawTx tx = ((IHistoryManager)bufferStrategy).newTx(); if (m_rawTxs.put(state.tx, tx) != null) { throw new IllegalStateException( "Unexpected existing RawTx"); } } super.activateTx(state); }
@Override protected void deactivateTx(final TxState state) { if (txLog.isInfoEnabled()) txLog.info("CLOSE: txId=" + state.tx + ", readsOnCommitTime=" + state.getReadsOnCommitTime()); /* * Note: We need to deactivate the tx before RawTx.close() is * invoked otherwise the activeTxCount will never be zero inside * of RawTx.close() and the session protection mode of the * RWStore will never be able to release storage. */ super.deactivateTx(state); final IRawTx tx = m_rawTxs.remove(state.tx); if (tx != null) { tx.close(); } }