public final class GammaTxnConfig extends Object implements TxnConfig, GammaConstants
Modifier and Type | Field and Description |
---|---|
BackoffPolicy |
backoffPolicy |
boolean |
blockingAllowed |
boolean |
controlFlowErrorsReused |
boolean |
dirtyCheck |
String |
familyName |
GlobalConflictCounter |
globalConflictCounter |
static AtomicLong |
idGenerator |
boolean |
inconsistentReadAllowed |
boolean |
interruptible |
boolean |
isAnonymous |
boolean |
isFat |
IsolationLevel |
isolationLevel |
int |
maxFixedLengthTransactionSize |
int |
maximumPoorMansConflictScanLength |
int |
maxRetries |
int |
minimalArrayTreeSize |
ArrayList<TxnListener> |
permanentListeners |
PropagationLevel |
propagationLevel |
LockMode |
readLockMode |
int |
readLockModeAsInt |
boolean |
readonly |
boolean |
speculative |
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_UNCOMMITTED
LOCKMODE_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.
|
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.
|
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(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) |
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 AtomicLong idGenerator
public final 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 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 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()
TxnConfig
getReadLockMode
in interface TxnConfig
TxnFactoryBuilder.setReadLockMode(LockMode)
public LockMode getWriteLockMode()
TxnConfig
getWriteLockMode
in interface TxnConfig
TxnFactoryBuilder.setWriteLockMode(LockMode)
public IsolationLevel getIsolationLevel()
TxnConfig
getIsolationLevel
in interface TxnConfig
TxnFactoryBuilder.setIsolationLevel(IsolationLevel)
public boolean isControlFlowErrorsReused()
TxnConfig
ControlFlowError
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 TxnConfig
TxnFactoryBuilder.setControlFlowErrorsReused(boolean)
public SpeculativeGammaConfiguration getSpeculativeConfiguration()
public long getTimeoutNs()
TxnConfig
getTimeoutNs
in interface TxnConfig
TxnFactoryBuilder.setTimeoutNs(long)
public TraceLevel getTraceLevel()
TxnConfig
getTraceLevel
in interface TxnConfig
TxnFactoryBuilder.setTraceLevel(TraceLevel)
public boolean isInterruptible()
TxnConfig
isInterruptible
in interface TxnConfig
TxnFactoryBuilder.setInterruptible(boolean)
public BackoffPolicy getBackoffPolicy()
TxnConfig
getBackoffPolicy
in interface TxnConfig
TxnFactoryBuilder.setBackoffPolicy(BackoffPolicy)
public boolean isSpeculative()
TxnConfig
SpeculativeConfigurationError
. 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 TxnConfig
TxnFactoryBuilder.setSpeculative(boolean)
public String getFamilyName()
TxnConfig
getFamilyName
in interface TxnConfig
TxnFactoryBuilder.setFamilyName(String)
public boolean isReadonly()
TxnConfig
isReadonly
in interface TxnConfig
TxnFactoryBuilder.setReadonly(boolean)
public int getSpinCount()
TxnConfig
getSpinCount
in interface TxnConfig
TxnFactoryBuilder.setSpinCount(int)
public boolean isDirtyCheckEnabled()
TxnConfig
isDirtyCheckEnabled
in interface TxnConfig
TxnFactoryBuilder.setDirtyCheckEnabled(boolean)
public GammaStm getStm()
TxnConfig
public GlobalConflictCounter getGlobalConflictCounter()
public boolean isReadTrackingEnabled()
TxnConfig
isReadTrackingEnabled
in interface TxnConfig
TxnFactoryBuilder.setReadTrackingEnabled(boolean)
public boolean isBlockingAllowed()
TxnConfig
isBlockingAllowed
in interface TxnConfig
TxnFactoryBuilder.setBlockingAllowed(boolean)
public int getMaxRetries()
TxnConfig
getMaxRetries
in interface TxnConfig
TxnFactoryBuilder.setMaxRetries(int)
public PropagationLevel getPropagationLevel()
TxnConfig
getPropagationLevel
in interface TxnConfig
TxnFactoryBuilder.setPropagationLevel(PropagationLevel)
public List<TxnListener> getPermanentListeners()
TxnConfig
getPermanentListeners
in interface TxnConfig
TxnFactoryBuilder.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(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)
Copyright © 2020. All rights reserved.