|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.multiverse.stms.gamma.transactions.GammaTxn
public abstract class GammaTxn
Abstract GammaTxn to be used by all the concrete GammaTxn implementations.
| Field Summary | |
|---|---|
boolean |
abortOnly
|
int |
attempt
|
boolean |
commitConflict
|
GammaTxnConfig |
config
|
boolean |
evaluatingCommute
|
boolean |
hasWrites
|
ArrayList<TxnListener> |
listeners
|
GammaObjectPool |
pool
|
long |
remainingTimeoutNs
|
RetryLatch |
retryListener
|
boolean |
richmansMansConflictScan
|
int |
status
|
int |
transactionType
|
| Fields inherited from interface org.multiverse.MultiverseConstants |
|---|
LOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED |
| Constructor Summary | |
|---|---|
GammaTxn(GammaTxnConfig config,
int transactionType)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.multiverse.api.Txn |
|---|
prepare, retry |
| Field Detail |
|---|
public final GammaObjectPool pool
public int status
public GammaTxnConfig config
public int attempt
public long remainingTimeoutNs
public boolean hasWrites
public final int transactionType
public boolean richmansMansConflictScan
public boolean abortOnly
public final RetryLatch retryListener
public ArrayList<TxnListener> listeners
public boolean commitConflict
public boolean evaluatingCommute
| Constructor Detail |
|---|
public GammaTxn(GammaTxnConfig config,
int transactionType)
| Method Detail |
|---|
protected void notifyListeners(TxnEvent event)
protected RetryError newRetryError()
public final boolean isLean()
public final void abortIfAlive()
public AbortOnlyException abortPrepareOnAbortOnly()
public AbortOnlyException abortCommitOnAbortOnly()
public final ReadWriteConflict abortOnReadWriteConflict(GammaObject object)
public DeadTxnException failAbortOnAlreadyCommitted()
public SpeculativeConfigurationError abortOpenForReadOrWriteOnExplicitLockingDetected(BaseGammaTxnRef ref)
public SpeculativeConfigurationError abortOpenForReadOnNonRefTypeDetected(BaseGammaTxnRef ref)
public final StmMismatchException abortOpenForReadOnBadStm(GammaObject o)
public IllegalTxnStateException abortOpenForReadOnNullLockMode(BaseGammaTxnRef object)
public final IllegalTxnStateException abortOpenForReadOnBadStatus(GammaObject object)
public final ReadonlyException abortOpenForWriteOnReadonly(GammaObject object)
public final IllegalTxnStateException abortRetryOnNoRetryPossible()
public final RetryNotAllowedException abortRetryOnNoBlockingAllowed()
public final IllegalTxnStateException abortRetryOnBadStatus()
public final IllegalArgumentException abortOpenForConstructionOnBadReference(GammaObject ref)
public final IllegalTxnStateException abortOpenForConstructionOnBadStatus(GammaObject o)
public final StmMismatchException abortOpenForConstructionOnBadStm(GammaObject o)
public ReadonlyException abortOpenForConstructionOnReadonly(GammaObject o)
public SpeculativeConfigurationError abortOpenForConstructionRequired(BaseGammaTxnRef ref)
public SpeculativeConfigurationError abortCommuteOnCommuteDetected(BaseGammaTxnRef ref)
public IllegalTxnStateException abortCommuteOnBadStatus(GammaObject object,
Function function)
public StmMismatchException abortCommuteOnBadStm(GammaObject object)
public ReadonlyException abortCommuteOnReadonly(GammaObject object)
public NullPointerException abortCommuteOnNullFunction(GammaObject object)
public final IllegalTxnStateException abortLocateOnBadStatus(GammaObject object)
public final NullPointerException abortLocateOnNullArgument()
public SpeculativeConfigurationError abortRegisterOnListenerRequired()
public final IllegalTxnStateException abortPrepareOnBadStatus()
public final IllegalTxnStateException abortCommitOnBadStatus()
public TxnExecutionException abortOnOpenForConstructionWhileEvaluatingCommute(GammaObject o)
public TxnExecutionException abortOnOpenForReadWhileEvaluatingCommute(GammaObject o)
public TxnExecutionException abortOnOpenForCommuteWhileEvaluatingCommute(GammaObject o)
public IllegalTxnStateException abortEnsureOnBadStatus(BaseGammaTxnRef o)
public final SpeculativeConfigurationError abortOnTransactionTooSmall(int minimalSize)
public final SpeculativeConfigurationError abortOnRichmanConflictScanDetected()
public SpeculativeConfigurationError abortEnsureOnEnsureDetected(GammaObject o)
public final NullPointerException abortAcquireOnNullLockMode(GammaObject o)
public final boolean hasWrites()
public abstract void commit()
TxnTxn will always be aborted if the commit does not succeed.
Commit will not throw a ReadWriteConflict after the transaction is prepared.
So if prepared successfully, a commit will always succeed.
If there are TxnListeners (either normal ones or permanent ones) and they thrown a RuntimeException
or Error, this will be re-thrown. If a listener fails after the prepare/commit the transaction still is
committed.
commit in interface Txnpublic abstract void abort()
TxnIf the Txn already is aborted, the call is ignored.
abort in interface Txnpublic abstract Tranlocal locate(BaseGammaTxnRef o)
public final GammaTxnConfig getConfig()
TxnBecause the Txn can be reused, the TxnConfig used by this Txn doesn't need to be constant.
getConfig in interface Txnpublic final int getAttempt()
TxnTxnConfig.getMaxRetries()
getAttempt in interface Txnpublic final long getRemainingTimeoutNs()
TxnThe remaining timeout only is decreased if a transaction blocks on a retry or when doing a backoff.
getRemainingTimeoutNs in interface Txnpublic boolean isAbortOnly()
TxnThis method is not threadsafe, so can only be called by the thread that used the transaction.
isAbortOnly in interface Txnpublic final void setAbortOnly()
TxnAbortOnlyException is thrown.
This method is not threadsafe, so can only be called by the thread that used the transaction.
setAbortOnly in interface Txnpublic void register(TxnListener listener)
TxnTxnFactoryBuilder.addPermanentListener(org.multiverse.api.lifecycle.TxnListener).
If a TxnListener is added more than once, it is executed more than once. No checks are made. The permanent listeners are executed in the order they are added.
If a TxnListener throws an Error/RuntimeException and the transaction still is alive, it is aborted. For compensating and deferred actions this is not an issue, but for the PrePrepare state or the state it could since the transaction is aborted.
register in interface Txnlistener - the listener to add.public abstract void hardReset()
public abstract boolean softReset()
public abstract Tranlocal getRefTranlocal(BaseGammaTxnRef ref)
ref - the AbstractGammaTxnRef
public final boolean isAlive()
public final void awaitUpdate()
public final void copyForSpeculativeFailure(GammaTxn failingTx)
public final void init(GammaTxnConfig config)
public abstract boolean isReadConsistent(Tranlocal justAdded)
public final TxnStatus getStatus()
Txn
getStatus in interface Txnpublic final boolean skipPrepare()
public abstract void initLocalConflictCounter()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||