|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.AbstractService
com.bigdata.service.AbstractTransactionService
com.bigdata.journal.JournalTransactionService
public class JournalTransactionService
Implementation for a standalone journal using single-phase commits.
| Nested Class Summary | |
|---|---|
static class |
JournalTransactionService.SinglePhaseCommit
This task is an UNISOLATED operation that validates and commits a transaction known to have non-empty write sets. |
| Nested classes/interfaces inherited from class com.bigdata.service.AbstractTransactionService |
|---|
AbstractTransactionService.Options, AbstractTransactionService.TxState |
| Field Summary | |
|---|---|
protected Journal |
journal
|
| Fields inherited from class com.bigdata.service.AbstractTransactionService |
|---|
countersRoot, DEBUG, ERR_NO_SUCH, ERR_NOT_ACTIVE, ERR_READ_ONLY, ERR_SERVICE_NOT_AVAIL, INFO, lock, log, startTimeIndex, txDeactivate |
| Constructor Summary | |
|---|---|
JournalTransactionService(Properties properties,
Journal journal)
|
|
| Method Summary | |
|---|---|
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). |
boolean |
committed(long tx,
UUID dataService)
Throws exception since distributed transactions are not used for a single Journal. |
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. |
long |
getReleaseTime()
Always returns ZERO (0L) since history can not be released on the Journal. |
void |
notifyCommit(long commitTime)
Ignored since the Journal records the last commit time
in its root blocks. |
long |
prepared(long tx,
UUID dataService)
Throws exception since distributed transactions are not used for a single Journal. |
JournalTransactionService |
start()
Verifies that AbstractTransactionService.nextTimestamp() will not report a time before
AbstractTransactionService.getLastCommitTime() and then changes the TxServiceRunState
to TxServiceRunState.Running. |
| Methods inherited from class com.bigdata.service.AbstractTransactionService |
|---|
abort, assertOpen, assignTransactionIdentifier, commit, declareResources, destroy, findUnusedTimestamp, getAbortCount, getActiveCount, getCommitCount, getCounters, getMinReleaseAge, getProperties, getReadOnlyActiveCount, getReadWriteActiveCount, getRunState, getServiceIface, getStartCount, getStartTime, isOpen, newTx, nextTimestamp, setReleaseTime, setRunState, shutdown, shutdownNow, updateReleaseTime |
| Methods inherited from class com.bigdata.service.AbstractService |
|---|
clearLoggingContext, getHostname, getServiceName, getServiceUUID, setServiceUUID, setupLoggingContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.bigdata.service.IService |
|---|
getHostname, getServiceName, getServiceUUID |
| Field Detail |
|---|
protected final Journal journal
| Constructor Detail |
|---|
public JournalTransactionService(Properties properties,
Journal journal)
properties - | Method Detail |
|---|
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
deactivateTx in class AbstractTransactionServicestate - The transaction.protected long findCommitTime(long timestamp)
AbstractTransactionService
findCommitTime in class AbstractTransactionServicetimestamp - The timestamp.
protected long findNextCommitTime(long commitTime)
AbstractTransactionService
findNextCommitTime 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 AbstractTransactionServiceExecutionException
InterruptedExceptionpublic final long getLastCommitTime()
getLastCommitTime in interface ITransactionServicegetLastCommitTime in class AbstractTransactionServicepublic void notifyCommit(long commitTime)
Journal records the last commit time
in its root blocks.
notifyCommit in interface ITransactionServicenotifyCommit in class AbstractTransactionServicecommitTime - The commit time.public long getReleaseTime()
Journal.
getReleaseTime in interface ITransactionServicegetReleaseTime in class AbstractTransactionServiceAbstractTransactionService.Options.MIN_RELEASE_AGE
public long prepared(long tx,
UUID dataService)
throws IOException
Journal.
tx - The transaction identifier.dataService - The UUID of the IDataService which sent the
message.
IOException - if there is an RMI problem.
public boolean committed(long tx,
UUID dataService)
throws IOException
Journal.
tx - The transaction identifier.dataService - The UUID of the IDataService which sent the
message.
true if the distributed commit was successfull and
false if there was a problem.
IOExceptionpublic AbstractFederation getFederation()
getFederation in class AbstractServiceUnsupportedOperationException - always.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||