|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.service.AbstractTransactionService.TxState
protected class AbstractTransactionService.TxState
Transaction state as maintained by the ITransactionService.
Note: The commitTime and revisionTime are requested by the local transaction manager for single phase commits, which means that this class could only know their values for a distributed transaction commit. Hence they are not represented here.
| Field Summary | |
|---|---|
protected ReentrantLock |
lock
A per-transaction lock used to serialize operations on a given transaction. |
boolean |
readOnly
true iff the transaction is read-only. |
long |
tx
The transaction identifier. |
| Constructor Summary | |
|---|---|
protected |
AbstractTransactionService.TxState(long tx)
|
| Method Summary | |
|---|---|
void |
declareResources(UUID dataService,
String[] resource)
Declares resources on a data service instance on which the transaction will write. |
boolean |
equals(ITx o)
True iff they are the same object or have the same start timestamp. |
long |
getCommitTime()
The commit time assigned to a distributed read-write transaction during the commit protocol. |
int |
getDataServiceCount()
Return the #of IDataServices on which a read-write
transaction has executed an operation. |
protected UUID[] |
getDataServiceUUIDs()
The set of DataServices on which the transaction has
written. |
String[] |
getResources()
Return the resources declared by the transaction. |
int |
hashCode()
The hash code is based on the #getStartTimestamp(). |
boolean |
isAborted()
|
boolean |
isActive()
|
boolean |
isCommitted()
|
boolean |
isComplete()
|
boolean |
isPrepared()
|
boolean |
isReadOnly()
|
boolean |
isStartedOn(UUID dataServiceUUID)
Return true iff the dataService identified by the
UUID is one on which this transaction has been started. |
protected void |
setCommitTime(long commitTime)
Sets the assigned commit time. |
void |
setRunState(RunState newval)
Change the RunState. |
String |
toString()
Returns a string representation of the transaction state. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final long tx
public final boolean readOnly
true iff the transaction is read-only.
protected final ReentrantLock lock
RunState.
| Constructor Detail |
|---|
protected AbstractTransactionService.TxState(long tx)
| Method Detail |
|---|
public void setRunState(RunState newval)
RunState.
newval - The new RunState.
IllegalArgumentException - if the argument is null.
IllegalStateException - if the state transition is not allowed.RunState.isTransitionAllowed(RunState)public long getCommitTime()
IllegalStateException - if the commit time has not been assigned.protected void setCommitTime(long commitTime)
commitTime - The assigned commit time.public String[] getResources()
public boolean isStartedOn(UUID dataServiceUUID)
true iff the dataService identified by the
UUID is one on which this transaction has been started.
dataServiceUUID - The UUID identifying an IDataService.
true if this transaction has been started on
that IDataService. false for
read-only transactions.protected UUID[] getDataServiceUUIDs()
DataServices on which the transaction has
written.
IllegalStateException - if not a read-write transaction.public final int hashCode()
#getStartTimestamp().
hashCode in class Objectpublic final boolean equals(ITx o)
o - Another transaction object.
public final void declareResources(UUID dataService,
String[] resource)
dataService - The data service identifier.resource - An array of named resources on the data service on which
the transaction will write (or at least for which it
requires an exclusive write lock).
IllegalStateException - if the transaction is read-only.
IllegalStateException - if the transaction is not active.public final int getDataServiceCount()
IDataServices on which a read-write
transaction has executed an operation.
IDataService.
IllegalStateException - if the transaction is read-only.
IllegalMonitorStateException - if the caller does not hold the lock.public final String toString()
toString in class Objectpublic final boolean isReadOnly()
public final boolean isActive()
public final boolean isPrepared()
public final boolean isComplete()
public final boolean isCommitted()
public final boolean isAborted()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||