public final class GammaTxnConfig extends java.lang.Object implements TxnConfig, GammaConstants
| Modifier and Type | Field and Description |
|---|---|
BackoffPolicy |
backoffPolicy |
boolean |
blockingAllowed |
boolean |
controlFlowErrorsReused |
boolean |
dirtyCheck |
java.lang.String |
familyName |
GlobalConflictCounter |
globalConflictCounter |
static java.util.concurrent.atomic.AtomicLong |
idGenerator |
boolean |
inconsistentReadAllowed |
boolean |
interruptible |
boolean |
isAnonymous |
boolean |
isFat |
IsolationLevel |
isolationLevel |
int |
maxFixedLengthTransactionSize |
int |
maximumPoorMansConflictScanLength |
int |
maxRetries |
int |
minimalArrayTreeSize |
java.util.ArrayList<TxnListener> |
permanentListeners |
PropagationLevel |
propagationLevel |
LockMode |
readLockMode |
int |
readLockModeAsInt |
boolean |
readonly |
boolean |
speculative |
java.util.concurrent.atomic.AtomicReference<SpeculativeGammaConfiguration> |
speculativeConfiguration |
int |
spinCount |
GammaStm |
stm |
long |
timeoutNs |
TraceLevel |
traceLevel |
boolean |
trackReads |
boolean |
unrepeatableReadAllowed |
LockMode |
writeLockMode |
int |
writeLockModeAsInt |
boolean |
writeSkewAllowed |
FAILURE, MASK_CONFLICT, MASK_SUCCESS, MASK_UNREGISTERED, REGISTRATION_DONE, REGISTRATION_NONE, REGISTRATION_NOT_NEEDED, TRANLOCAL_COMMUTING, TRANLOCAL_CONSTRUCTING, TRANLOCAL_READ, TRANLOCAL_WRITE, TRANSACTIONTYPE_FAT_FIXED_LENGTH, TRANSACTIONTYPE_FAT_MONO, TRANSACTIONTYPE_FAT_VARIABLE_LENGTH, TRANSACTIONTYPE_LEAN_FIXED_LENGTH, TRANSACTIONTYPE_LEAN_MONO, TX_ABORTED, TX_ACTIVE, TX_COMMITTED, TX_PREPARED, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_REF, VERSION_UNCOMMITTEDLOCKMODE_EXCLUSIVE, LOCKMODE_NONE, LOCKMODE_READ, LOCKMODE_WRITE, SHAKE_BUGS, SPIN_YIELD, TRACING_ENABLED| Constructor and Description |
|---|
GammaTxnConfig(GammaStm stm) |
GammaTxnConfig(GammaStm stm,
GammaStmConfig config) |
GammaTxnConfig(GammaStm stm,
int maxFixedLengthTransactionSize) |
| Modifier and Type | Method and Description |
|---|---|
GammaTxnConfig |
addPermanentListener(TxnListener listener) |
BackoffPolicy |
getBackoffPolicy()
Returns the BackoffPolicy used by the Stm when a transaction conflicts with another transaction.
|
java.lang.String |
getFamilyName()
Returns the family name of this Txn.
|
GlobalConflictCounter |
getGlobalConflictCounter() |
IsolationLevel |
getIsolationLevel()
Gets the IsolationLevel used.
|
int |
getMaxRetries()
Returns the maximum number of times this Txn be retried before failing.
|
java.util.List<TxnListener> |
getPermanentListeners()
Returns an unmodifiable list containing all permanent TxnListener.
|
PropagationLevel |
getPropagationLevel()
Returns the PropagationLevel used.
|
LockMode |
getReadLockMode()
Gets the current LockMode for all reads.
|
SpeculativeGammaConfiguration |
getSpeculativeConfiguration() |
int |
getSpinCount()
Returns the maximum number of times the transaction is allowed to spin on a read to become
readable (perhaps it is locked).
|
GammaStm |
getStm()
Returns the Stm that creates transactions based on this configuration.
|
long |
getTimeoutNs()
Returns the total timeout in nanoseconds.
|
TraceLevel |
getTraceLevel()
Returns the TraceLevel.
|
LockMode |
getWriteLockMode()
Gets the current LockMode for all writes.
|
GammaTxnConfig |
init() |
boolean |
isBlockingAllowed()
If an explicit retry (so a blocking transaction) is allowed.
|
boolean |
isControlFlowErrorsReused()
Checks if the
ControlFlowError is cached or a new one is used. |
boolean |
isDirtyCheckEnabled()
Checks if dirty check is enabled on writes when a transaction commits.
|
boolean |
isInterruptible()
Checks if the Txn can be interrupted if it is blocking.
|
boolean |
isReadonly()
Checks if this Txn is readonly.
|
boolean |
isReadTrackingEnabled()
Checks if this transaction does automatic read tracking.
|
boolean |
isSpeculative()
Checks if speculative configuration is enabled.
|
GammaTxnConfig |
setBackoffPolicy(BackoffPolicy backoffPolicy) |
GammaTxnConfig |
setBlockingAllowed(boolean blockingAllowed) |
GammaTxnConfig |
setControlFlowErrorsReused(boolean controlFlowErrorsReused) |
GammaTxnConfig |
setDirtyCheckEnabled(boolean dirtyCheck) |
GammaTxnConfig |
setFamilyName(java.lang.String familyName) |
GammaTxnConfig |
setFat() |
GammaTxnConfig |
setInterruptible(boolean interruptible) |
GammaTxnConfig |
setIsolationLevel(IsolationLevel isolationLevel) |
GammaTxnConfig |
setMaximumPoorMansConflictScanLength(int maximumPoorMansConflictScanLength) |
GammaTxnConfig |
setMaxRetries(int maxRetries) |
GammaTxnConfig |
setPropagationLevel(PropagationLevel propagationLevel) |
GammaTxnConfig |
setReadLockMode(LockMode readLockMode) |
GammaTxnConfig |
setReadonly(boolean readonly) |
GammaTxnConfig |
setReadTrackingEnabled(boolean trackReads) |
GammaTxnConfig |
setSpeculative(boolean speculativeConfigEnabled) |
GammaTxnConfig |
setSpinCount(int spinCount) |
GammaTxnConfig |
setTimeoutNs(long timeoutNs) |
GammaTxnConfig |
setTraceLevel(TraceLevel traceLevel) |
GammaTxnConfig |
setWriteLockMode(LockMode writeLockMode) |
java.lang.String |
toString() |
void |
updateSpeculativeConfigurationToUseCommute() |
void |
updateSpeculativeConfigurationToUseConstructedObjects() |
void |
updateSpeculativeConfigurationToUseEnsure() |
void |
updateSpeculativeConfigurationToUseExplicitLocking() |
void |
updateSpeculativeConfigurationToUseListeners() |
void |
updateSpeculativeConfigurationToUseMinimalTransactionLength(int newLength) |
void |
updateSpeculativeConfigurationToUseNonRefType() |
void |
updateSpeculativeConfigurationToUseRichMansConflictScan() |
void |
updateSpeculativeConfigureToUseAbortOnly() |
public static final java.util.concurrent.atomic.AtomicLong idGenerator
public final java.util.concurrent.atomic.AtomicReference<SpeculativeGammaConfiguration> speculativeConfiguration
public final GammaStm stm
public final GlobalConflictCounter globalConflictCounter
public PropagationLevel propagationLevel
public IsolationLevel isolationLevel
public boolean writeSkewAllowed
public boolean inconsistentReadAllowed
public LockMode readLockMode
public LockMode writeLockMode
public int readLockModeAsInt
public int writeLockModeAsInt
public java.lang.String familyName
public boolean isAnonymous
public boolean interruptible
public boolean readonly
public int spinCount
public boolean dirtyCheck
public int minimalArrayTreeSize
public boolean trackReads
public boolean blockingAllowed
public int maxRetries
public boolean speculative
public int maxFixedLengthTransactionSize
public BackoffPolicy backoffPolicy
public long timeoutNs
public TraceLevel traceLevel
public boolean controlFlowErrorsReused
public boolean isFat
public int maximumPoorMansConflictScanLength
public java.util.ArrayList<TxnListener> permanentListeners
public boolean unrepeatableReadAllowed
public GammaTxnConfig(GammaStm stm)
public GammaTxnConfig(GammaStm stm, GammaStmConfig config)
public GammaTxnConfig(GammaStm stm, int maxFixedLengthTransactionSize)
public LockMode getReadLockMode()
TxnConfiggetReadLockMode in interface TxnConfigTxnFactoryBuilder.setReadLockMode(LockMode)public LockMode getWriteLockMode()
TxnConfiggetWriteLockMode in interface TxnConfigTxnFactoryBuilder.setWriteLockMode(LockMode)public IsolationLevel getIsolationLevel()
TxnConfiggetIsolationLevel in interface TxnConfigTxnFactoryBuilder.setIsolationLevel(IsolationLevel)public boolean isControlFlowErrorsReused()
TxnConfigControlFlowError is cached or a new one is used.
Exception creation can be very expensive, so by default the ControlFlowError is reused, but this can
be problematic when debugging.isControlFlowErrorsReused in interface TxnConfigTxnFactoryBuilder.setControlFlowErrorsReused(boolean)public SpeculativeGammaConfiguration getSpeculativeConfiguration()
public long getTimeoutNs()
TxnConfiggetTimeoutNs in interface TxnConfigTxnFactoryBuilder.setTimeoutNs(long)public TraceLevel getTraceLevel()
TxnConfiggetTraceLevel in interface TxnConfigTxnFactoryBuilder.setTraceLevel(TraceLevel)public boolean isInterruptible()
TxnConfigisInterruptible in interface TxnConfigTxnFactoryBuilder.setInterruptible(boolean)public BackoffPolicy getBackoffPolicy()
TxnConfiggetBackoffPolicy in interface TxnConfigTxnFactoryBuilder.setBackoffPolicy(BackoffPolicy)public boolean isSpeculative()
TxnConfigSpeculativeConfigurationError. This will be caught by the
TxnExecutor and the transaction will be retried, so in most cases this is not something to worry
about, but it can be confusing in the beginning because of unexpected failures in the execution
of transactions.isSpeculative in interface TxnConfigTxnFactoryBuilder.setSpeculative(boolean)public java.lang.String getFamilyName()
TxnConfiggetFamilyName in interface TxnConfigTxnFactoryBuilder.setFamilyName(String)public boolean isReadonly()
TxnConfigisReadonly in interface TxnConfigTxnFactoryBuilder.setReadonly(boolean)public int getSpinCount()
TxnConfiggetSpinCount in interface TxnConfigTxnFactoryBuilder.setSpinCount(int)public boolean isDirtyCheckEnabled()
TxnConfigisDirtyCheckEnabled in interface TxnConfigTxnFactoryBuilder.setDirtyCheckEnabled(boolean)public GammaStm getStm()
TxnConfigpublic GlobalConflictCounter getGlobalConflictCounter()
public boolean isReadTrackingEnabled()
TxnConfigisReadTrackingEnabled in interface TxnConfigTxnFactoryBuilder.setReadTrackingEnabled(boolean)public boolean isBlockingAllowed()
TxnConfigisBlockingAllowed in interface TxnConfigTxnFactoryBuilder.setBlockingAllowed(boolean)public int getMaxRetries()
TxnConfiggetMaxRetries in interface TxnConfigTxnFactoryBuilder.setMaxRetries(int)public PropagationLevel getPropagationLevel()
TxnConfiggetPropagationLevel in interface TxnConfigTxnFactoryBuilder.setPropagationLevel(PropagationLevel)public java.util.List<TxnListener> getPermanentListeners()
TxnConfiggetPermanentListeners in interface TxnConfigTxnFactoryBuilder.addPermanentListener(org.multiverse.api.lifecycle.TxnListener)public void updateSpeculativeConfigurationToUseNonRefType()
public void updateSpeculativeConfigurationToUseListeners()
public void updateSpeculativeConfigureToUseAbortOnly()
public void updateSpeculativeConfigurationToUseCommute()
public void updateSpeculativeConfigurationToUseExplicitLocking()
public void updateSpeculativeConfigurationToUseConstructedObjects()
public void updateSpeculativeConfigurationToUseRichMansConflictScan()
public void updateSpeculativeConfigurationToUseMinimalTransactionLength(int newLength)
public void updateSpeculativeConfigurationToUseEnsure()
public GammaTxnConfig init()
public GammaTxnConfig setTimeoutNs(long timeoutNs)
public GammaTxnConfig setFamilyName(java.lang.String familyName)
public GammaTxnConfig setMaxRetries(int maxRetries)
public GammaTxnConfig setMaximumPoorMansConflictScanLength(int maximumPoorMansConflictScanLength)
public GammaTxnConfig setReadTrackingEnabled(boolean trackReads)
public GammaTxnConfig setSpeculative(boolean speculativeConfigEnabled)
public GammaTxnConfig setReadonly(boolean readonly)
public GammaTxnConfig setDirtyCheckEnabled(boolean dirtyCheck)
public GammaTxnConfig setBlockingAllowed(boolean blockingAllowed)
public GammaTxnConfig setInterruptible(boolean interruptible)
public GammaTxnConfig setControlFlowErrorsReused(boolean controlFlowErrorsReused)
public GammaTxnConfig setSpinCount(int spinCount)
public GammaTxnConfig setBackoffPolicy(BackoffPolicy backoffPolicy)
public GammaTxnConfig setTraceLevel(TraceLevel traceLevel)
public GammaTxnConfig setPropagationLevel(PropagationLevel propagationLevel)
public GammaTxnConfig setIsolationLevel(IsolationLevel isolationLevel)
public GammaTxnConfig setWriteLockMode(LockMode writeLockMode)
public GammaTxnConfig setReadLockMode(LockMode readLockMode)
public GammaTxnConfig setFat()
public GammaTxnConfig addPermanentListener(TxnListener listener)
public java.lang.String toString()
toString in class java.lang.Object