public abstract class JournalTransactionService extends AbstractHATransactionService
| Modifier and Type | Class and Description |
|---|---|
static class |
JournalTransactionService.SinglePhaseCommit
This task is an UNISOLATED operation that validates and commits a
transaction known to have non-empty write sets.
|
static class |
JournalTransactionService.ValidateWriteSetTask
This task is an UNISOLATED operation that validates a transaction known to
have non-empty write sets.
|
AbstractTransactionService.Options, AbstractTransactionService.TxStateERR_NO_SUCH, ERR_NOT_ACTIVE, ERR_READ_ONLY, ERR_SERVICE_NOT_AVAIL, lock, log, txDeactivate| Constructor and Description |
|---|
JournalTransactionService(Properties properties,
Journal journal) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
abortImpl(AbstractTransactionService.TxState state)
Implementation must abort the tx on the journal (standalone) or on each
data service (federation) on which it has written.
|
protected void |
activateTx(AbstractTransactionService.TxState state)
Extended to register the new tx in the
AbstractLocalTransactionManager. |
protected long |
commitImpl(AbstractTransactionService.TxState state)
Implementation must either single-phase commit (standalone journal or a
transaction that only writes on a single data service) or 2-/3-phase
commit (distributed transaction running on a federation).
|
protected void |
deactivateTx(AbstractTransactionService.TxState state)
Removes the transaction from the local tables.
|
protected long |
findCommitTime(long timestamp)
Find the commit time from which the tx will read (largest commitTime LTE
timestamp).
|
protected long |
findNextCommitTime(long commitTime)
Return the commit time for the successor of that commit point have the
specified timestamp (a commit time strictly GT the given value).
|
AbstractFederation<?> |
getFederation()
Throws exception.
|
long |
getLastCommitTime()
The last commit time from the current root block.
|
JournalTransactionService |
start()
Verifies that
AbstractTransactionService.nextTimestamp() will not report a time before
AbstractTransactionService.getLastCommitTime() and then changes the TxServiceRunState
to TxServiceRunState.Running. |
newGatherMinimumVisibleCommitTimeTask, runWithBarrierLock, setReleaseTime, updateReleaseTimeConsensusabort, abortAllTx, assertOpen, assignTransactionIdentifier, commit, destroy, findUnusedTimestamp, getAbortCount, getActiveCount, getCommitCount, getCounters, getEarliestActiveTx, getEffectiveReleaseTimeForHA, getMinReleaseAge, getProperties, getReadOnlyActiveCount, getReadsOnTime, getReadWriteActiveCount, getReleaseTime, getRunState, getServiceIface, getStartCount, getTxState, isOpen, isReleaseTimeConsensusProtocol, newTx, nextTimestamp, notifyCommit, setRunState, shutdown, shutdownNow, updateReleaseTime, updateReleaseTimeForBareCommitclearLoggingContext, getHostname, getServiceName, getServiceUUID, setServiceUUID, setupLoggingContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgatherMinimumVisibleCommitTime, notifyEarliestCommitTimegetHostname, getServiceName, getServiceUUIDpublic JournalTransactionService(Properties properties, Journal journal)
properties - public JournalTransactionService start()
AbstractTransactionServiceAbstractTransactionService.nextTimestamp() will not report a time before
AbstractTransactionService.getLastCommitTime() and then changes the TxServiceRunState
to TxServiceRunState.Running.start in class AbstractTransactionServiceprotected void activateTx(AbstractTransactionService.TxState state)
AbstractLocalTransactionManager.activateTx in class AbstractTransactionServicestate - The transaction.protected void deactivateTx(AbstractTransactionService.TxState state)
AbstractTransactionService
Note: The caller MUST own AbstractTransactionService.TxState.lock across this method and
MUST then do
updateReleaseTime(long) deactivateTx.signallAll()while holding the outer
AbstractTransactionService.lock.
Note: Normally this method is invoked without the outer AbstractTransactionService.lock
which necessitates lifting those method calls out of this method and into
the caller.
deactivateTx in class AbstractTransactionServicestate - The transaction.protected long findCommitTime(long timestamp)
AbstractTransactionServicefindCommitTime in class AbstractTransactionServicetimestamp - The timestamp.protected long findNextCommitTime(long commitTime)
AbstractTransactionServicefindNextCommitTime in class AbstractTransactionServicecommitTime - The probe.protected void abortImpl(AbstractTransactionService.TxState state)
AbstractTransactionServicePre-conditions:
RunState.Active; andAbstractTransactionService.TxState.lock.Post-conditions:
RunState.Aborted; andJournal
or IDataService or which it has written (applicable for
read-write transactions only).abortImpl in class AbstractTransactionServicestate - The transaction state as maintained by the transaction server.protected long commitImpl(AbstractTransactionService.TxState state) throws ExecutionException, InterruptedException
AbstractTransactionServicePre-conditions:
RunState.Active; andAbstractTransactionService.TxState.lock.Post-conditions (success for read-only transaction or a read-write transaction with an empty write set):
RunState.Committed; andPost-conditions (success for read-write transaction with a non-empty write set):
RunState.Committed;Journal or IDataService or which it has written
(applicable for read-write transactions only); andPost-conditions (failure):
RunState.Aborted; andJournal
or IDataService or which it has written (applicable for
read-write transactions only).commitImpl in class AbstractTransactionServiceExecutionExceptionInterruptedExceptionpublic final long getLastCommitTime()
getLastCommitTime in interface ITransactionServicegetLastCommitTime in class AbstractTransactionServicepublic AbstractFederation<?> getFederation()
getFederation in class AbstractServiceUnsupportedOperationException - always.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.