|
||||||||||
| 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 |
|---|
ERR_NO_SUCH, ERR_NOT_ACTIVE, ERR_READ_ONLY, ERR_SERVICE_NOT_AVAIL, 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 |
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.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
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)
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 AbstractTransactionService
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 | |||||||||