public class TransactionOptions
extends java.lang.Object
Transaction
.Constructor and Description |
---|
TransactionOptions(OptionConsumer consumer) |
Modifier and Type | Method and Description |
---|---|
OptionConsumer |
getOptionConsumer()
Returns the object on which these options are being set.
|
void |
setAccessSystemKeys()
Allows this transaction to read and modify system keys (those that start with the byte 0xFF).
|
void |
setAutoThrottleTag(java.lang.String value)
Adds a tag to the transaction that can be used to apply manual or automatic targeted throttling.
|
void |
setBypassUnreadable()
Allows
get operations to read from sections of keyspace that have become unreadable because of versionstamp operations. |
void |
setCausalReadDisable() |
void |
setCausalReadRisky()
The read version will be committed, and usually will be the latest committed, but might not be the latest committed in the event of a simultaneous fault and misbehaving clock.
|
void |
setCausalWriteRisky()
The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault.
|
void |
setDebugRetryLogging(java.lang.String value) |
void |
setDebugTransactionIdentifier(java.lang.String value)
Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling.
|
void |
setDurabilityDatacenter() |
void |
setDurabilityDevNullIsWebScale()
Deprecated.
|
void |
setDurabilityRisky() |
void |
setIncludePortInAddress()
Addresses returned by get_addresses_for_key include the port when enabled.
|
void |
setInitializeNewDatabase()
This is a write-only transaction which sets the initial configuration.
|
void |
setLockAware()
The transaction can read and write to locked databases, and is responsible for checking that it took the lock.
|
void |
setLogTransaction()
Enables tracing for this transaction and logs results to the client trace logs.
|
void |
setMaxRetryDelay(long value)
Set the maximum amount of backoff delay incurred in the call to
onError if the error is retryable. |
void |
setNextWriteNoWriteConflictRange()
The next write performed on this transaction will not generate a write conflict range.
|
void |
setPriorityBatch()
Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first.
|
void |
setPrioritySystemImmediate()
Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one.
|
void |
setReadAheadDisable()
Deprecated.
|
void |
setReadLockAware()
The transaction can read from locked databases.
|
void |
setReadSystemKeys()
Allows this transaction to read system keys (those that start with the byte 0xFF).
|
void |
setReadYourWritesDisable()
Reads performed by a transaction will not see any prior mutations that occured in that transaction, instead seeing the value which was in the database at the transaction's read version.
|
void |
setReportConflictingKeys()
The transaction can retrieve keys that are conflicting with other transactions.
|
void |
setRetryLimit(long value)
Set a maximum number of retries after which additional calls to
onError will throw the most recently seen error code. |
void |
setServerRequestTracing()
Sets an identifier for server tracing of this transaction.
|
void |
setSizeLimit(long value)
Set the transaction size limit in bytes.
|
void |
setSnapshotRywDisable()
Snapshot read operations will not see the results of writes done in the same transaction.
|
void |
setSnapshotRywEnable()
Snapshot read operations will see the results of writes done in the same transaction.
|
void |
setSpecialKeySpaceRelaxed()
By default, the special key space will only allow users to read from exactly one module (a subspace in the special key space).
|
void |
setTag(java.lang.String value)
Adds a tag to the transaction that can be used to apply manual targeted throttling.
|
void |
setTimeout(long value)
Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled.
|
void |
setTransactionLoggingEnable(java.lang.String value)
Deprecated.
|
void |
setTransactionLoggingMaxFieldLength(long value)
Sets the maximum escaped length of key and value fields to be logged to the trace file via the LOG_TRANSACTION option, after which the field will be truncated.
|
void |
setUsedDuringCommitProtectionDisable()
By default, operations that are performed on a transaction while it is being committed will not only fail themselves, but they will attempt to fail other in-flight operations (such as the commit) as well.
|
void |
setUseProvisionalProxies()
This option should only be used by tools which change the database configuration.
|
public TransactionOptions(OptionConsumer consumer)
public void setCausalWriteRisky()
public void setCausalReadRisky()
public void setIncludePortInAddress()
public void setNextWriteNoWriteConflictRange()
public void setReadYourWritesDisable()
@Deprecated public void setReadAheadDisable()
@Deprecated public void setDurabilityDevNullIsWebScale()
public void setPrioritySystemImmediate()
public void setPriorityBatch()
public void setInitializeNewDatabase()
public void setAccessSystemKeys()
public void setReadSystemKeys()
@Deprecated public void setTransactionLoggingEnable(java.lang.String value)
value
- String identifier to be used in the logs when tracing this transaction. The identifier must not exceed 100 characters.public void setDebugTransactionIdentifier(java.lang.String value)
value
- String identifier to be used when tracing or profiling this transaction. The identifier must not exceed 100 characters.public void setLogTransaction()
public void setTransactionLoggingMaxFieldLength(long value)
value
- Maximum length of escaped key and value fields.public void setServerRequestTracing()
public void setTimeout(long value)
[0, INT_MAX]
. If set to 0, will disable all timeouts. All pending and any future uses of the transaction will throw an exception. The transaction can be used again after it is reset. Prior to API version 610, like all other transaction options, the timeout must be reset after a call to onError
. If the API version is 610 or greater, the timeout is not reset after an onError
call. This allows the user to specify a longer timeout on specific transactions than the default timeout specified through the transaction_timeout
database option without the shorter database timeout cancelling transactions that encounter a retryable error. Note that at all API versions, it is safe and legal to set the timeout each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.value
- value in milliseconds of timeoutpublic void setRetryLimit(long value)
onError
will throw the most recently seen error code. Valid parameter values are [-1, INT_MAX]
. If set to -1, will disable the retry limit. Prior to API version 610, like all other transaction options, the retry limit must be reset after a call to onError
. If the API version is 610 or greater, the retry limit is not reset after an onError
call. Note that at all API versions, it is safe and legal to set the retry limit each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.value
- number of times to retrypublic void setMaxRetryDelay(long value)
onError
if the error is retryable. Defaults to 1000 ms. Valid parameter values are [0, INT_MAX]
. If the maximum retry delay is less than the current retry delay of the transaction, then the current retry delay will be clamped to the maximum retry delay. Prior to API version 610, like all other transaction options, the maximum retry delay must be reset after a call to onError
. If the API version is 610 or greater, the retry limit is not reset after an onError
call. Note that at all API versions, it is safe and legal to set the maximum retry delay each time the transaction begins, so most code written assuming the older behavior can be upgraded to the newer behavior without requiring any modification, and the caller is not required to implement special logic in retry loops to only conditionally set this option.value
- value in milliseconds of maximum delaypublic void setSizeLimit(long value)
value
- value in bytespublic void setSnapshotRywEnable()
public void setSnapshotRywDisable()
public void setLockAware()
public void setUsedDuringCommitProtectionDisable()
public void setReadLockAware()
public void setUseProvisionalProxies()
public void setReportConflictingKeys()
public void setSpecialKeySpaceRelaxed()
public void setTag(java.lang.String value)
value
- String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.public void setAutoThrottleTag(java.lang.String value)
value
- String identifier used to associated this transaction with a throttling group. Must not exceed 16 characters.public void setBypassUnreadable()
get
operations to read from sections of keyspace that have become unreadable because of versionstamp operations. These reads will view versionstamp operations as if they were set operations that did not fill in the versionstamp.public void setCausalReadDisable()
public void setDurabilityDatacenter()
public void setDurabilityRisky()
public void setDebugRetryLogging(java.lang.String value)
public OptionConsumer getOptionConsumer()