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.TxState
ERR_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, updateReleaseTimeConsensus
abort, 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, updateReleaseTimeForBareCommit
clearLoggingContext, getHostname, getServiceName, getServiceUUID, setServiceUUID, setupLoggingContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
gatherMinimumVisibleCommitTime, notifyEarliestCommitTime
getHostname, getServiceName, getServiceUUID
public JournalTransactionService(Properties properties, Journal journal)
properties
- public JournalTransactionService start()
AbstractTransactionService
AbstractTransactionService.nextTimestamp()
will not report a time before
AbstractTransactionService.getLastCommitTime()
and then changes the TxServiceRunState
to TxServiceRunState.Running
.start
in class AbstractTransactionService
protected void activateTx(AbstractTransactionService.TxState state)
AbstractLocalTransactionManager
.activateTx
in class AbstractTransactionService
state
- 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 AbstractTransactionService
state
- The transaction.protected long findCommitTime(long timestamp)
AbstractTransactionService
findCommitTime
in class AbstractTransactionService
timestamp
- The timestamp.protected long findNextCommitTime(long commitTime)
AbstractTransactionService
findNextCommitTime
in class AbstractTransactionService
commitTime
- The probe.protected void abortImpl(AbstractTransactionService.TxState state)
AbstractTransactionService
Pre-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 AbstractTransactionService
state
- The transaction state as maintained by the transaction server.protected long commitImpl(AbstractTransactionService.TxState state) throws ExecutionException, InterruptedException
AbstractTransactionService
Pre-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 AbstractTransactionService
ExecutionException
InterruptedException
public final long getLastCommitTime()
getLastCommitTime
in interface ITransactionService
getLastCommitTime
in class AbstractTransactionService
public AbstractFederation<?> getFederation()
getFederation
in class AbstractService
UnsupportedOperationException
- always.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.