{-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-- | NOTE: This file is generated from <https://github.com/apple/foundationdb/blob/master/fdbclient/vexillographer/fdb.options fdb.options>
-- by the generate-options executable in this project.
-- All documentation on the individual options in this namespace comes
-- from FoundationDB's documentation in @fdb.options@.
module FoundationDB.Options.TransactionOption where
import Data.ByteString.Char8 (ByteString)

{-# DEPRECATED
readAheadDisable "Deprecated in FDB C API"
 #-}
{-# DEPRECATED
durabilityDevNullIsWebScale "Deprecated in FDB C API"
 #-}
{-# DEPRECATED
transactionLoggingEnable "Deprecated in FDB C API"
 #-}
data TransactionOption = TransactionOptionString Int String
                       | TransactionOptionInt Int Int
                       | TransactionOptionBytes Int ByteString
                       | TransactionOptionFlag Int
                           deriving (Int -> TransactionOption -> ShowS
[TransactionOption] -> ShowS
TransactionOption -> String
(Int -> TransactionOption -> ShowS)
-> (TransactionOption -> String)
-> ([TransactionOption] -> ShowS)
-> Show TransactionOption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransactionOption] -> ShowS
$cshowList :: [TransactionOption] -> ShowS
show :: TransactionOption -> String
$cshow :: TransactionOption -> String
showsPrec :: Int -> TransactionOption -> ShowS
$cshowsPrec :: Int -> TransactionOption -> ShowS
Show, ReadPrec [TransactionOption]
ReadPrec TransactionOption
Int -> ReadS TransactionOption
ReadS [TransactionOption]
(Int -> ReadS TransactionOption)
-> ReadS [TransactionOption]
-> ReadPrec TransactionOption
-> ReadPrec [TransactionOption]
-> Read TransactionOption
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransactionOption]
$creadListPrec :: ReadPrec [TransactionOption]
readPrec :: ReadPrec TransactionOption
$creadPrec :: ReadPrec TransactionOption
readList :: ReadS [TransactionOption]
$creadList :: ReadS [TransactionOption]
readsPrec :: Int -> ReadS TransactionOption
$creadsPrec :: Int -> ReadS TransactionOption
Read, TransactionOption -> TransactionOption -> Bool
(TransactionOption -> TransactionOption -> Bool)
-> (TransactionOption -> TransactionOption -> Bool)
-> Eq TransactionOption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransactionOption -> TransactionOption -> Bool
$c/= :: TransactionOption -> TransactionOption -> Bool
== :: TransactionOption -> TransactionOption -> Bool
$c== :: TransactionOption -> TransactionOption -> Bool
Eq, Eq TransactionOption
Eq TransactionOption
-> (TransactionOption -> TransactionOption -> Ordering)
-> (TransactionOption -> TransactionOption -> Bool)
-> (TransactionOption -> TransactionOption -> Bool)
-> (TransactionOption -> TransactionOption -> Bool)
-> (TransactionOption -> TransactionOption -> Bool)
-> (TransactionOption -> TransactionOption -> TransactionOption)
-> (TransactionOption -> TransactionOption -> TransactionOption)
-> Ord TransactionOption
TransactionOption -> TransactionOption -> Bool
TransactionOption -> TransactionOption -> Ordering
TransactionOption -> TransactionOption -> TransactionOption
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: TransactionOption -> TransactionOption -> TransactionOption
$cmin :: TransactionOption -> TransactionOption -> TransactionOption
max :: TransactionOption -> TransactionOption -> TransactionOption
$cmax :: TransactionOption -> TransactionOption -> TransactionOption
>= :: TransactionOption -> TransactionOption -> Bool
$c>= :: TransactionOption -> TransactionOption -> Bool
> :: TransactionOption -> TransactionOption -> Bool
$c> :: TransactionOption -> TransactionOption -> Bool
<= :: TransactionOption -> TransactionOption -> Bool
$c<= :: TransactionOption -> TransactionOption -> Bool
< :: TransactionOption -> TransactionOption -> Bool
$c< :: TransactionOption -> TransactionOption -> Bool
compare :: TransactionOption -> TransactionOption -> Ordering
$ccompare :: TransactionOption -> TransactionOption -> Ordering
$cp1Ord :: Eq TransactionOption
Ord)

-- | The transaction, if not self-conflicting, may be committed a second time after commit succeeds, in the event of a fault
causalWriteRisky :: TransactionOption
causalWriteRisky = Int -> TransactionOption
TransactionOptionFlag (Int
10)

-- | 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.
causalReadRisky :: TransactionOption
causalReadRisky = Int -> TransactionOption
TransactionOptionFlag (Int
20)

-- | 
causalReadDisable :: TransactionOption
causalReadDisable = Int -> TransactionOption
TransactionOptionFlag (Int
21)

-- | Addresses returned by get_addresses_for_key include the port when enabled. As of api version 630, this option is enabled by default and setting this has no effect.
includePortInAddress :: TransactionOption
includePortInAddress = Int -> TransactionOption
TransactionOptionFlag (Int
23)

-- | The next write performed on this transaction will not generate a write conflict range. As a result, other transactions which read the key(s) being modified by the next write will not conflict with this transaction. Care needs to be taken when using this option on a transaction that is shared between multiple threads. When setting this option, write conflict ranges will be disabled on the next write operation, regardless of what thread it is on.
nextWriteNoWriteConflictRange :: TransactionOption
nextWriteNoWriteConflictRange = Int -> TransactionOption
TransactionOptionFlag (Int
30)

-- | Committing this transaction will bypass the normal load balancing across commit proxies and go directly to the specifically nominated 'first commit proxy'.
commitOnFirstProxy :: TransactionOption
commitOnFirstProxy = Int -> TransactionOption
TransactionOptionFlag (Int
40)

-- | 
checkWritesEnable :: TransactionOption
checkWritesEnable = Int -> TransactionOption
TransactionOptionFlag (Int
50)

-- | 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. This option may provide a small performance benefit for the client, but also disables a number of client-side optimizations which are beneficial for transactions which tend to read and write the same keys within a single transaction. It is an error to set this option after performing any reads or writes on the transaction.
readYourWritesDisable :: TransactionOption
readYourWritesDisable = Int -> TransactionOption
TransactionOptionFlag (Int
51)

-- | Deprecated
readAheadDisable :: TransactionOption
readAheadDisable = Int -> TransactionOption
TransactionOptionFlag (Int
52)

-- | 
durabilityDatacenter :: TransactionOption
durabilityDatacenter = Int -> TransactionOption
TransactionOptionFlag (Int
110)

-- | 
durabilityRisky :: TransactionOption
durabilityRisky = Int -> TransactionOption
TransactionOptionFlag (Int
120)

-- | Deprecated
durabilityDevNullIsWebScale :: TransactionOption
durabilityDevNullIsWebScale = Int -> TransactionOption
TransactionOptionFlag (Int
130)

-- | Specifies that this transaction should be treated as highest priority and that lower priority transactions should block behind this one. Use is discouraged outside of low-level tools
prioritySystemImmediate :: TransactionOption
prioritySystemImmediate = Int -> TransactionOption
TransactionOptionFlag (Int
200)

-- | Specifies that this transaction should be treated as low priority and that default priority transactions will be processed first. Batch priority transactions will also be throttled at load levels smaller than for other types of transactions and may be fully cut off in the event of machine failures. Useful for doing batch work simultaneously with latency-sensitive work
priorityBatch :: TransactionOption
priorityBatch = Int -> TransactionOption
TransactionOptionFlag (Int
201)

-- | This is a write-only transaction which sets the initial configuration. This option is designed for use by database system tools only.
initializeNewDatabase :: TransactionOption
initializeNewDatabase = Int -> TransactionOption
TransactionOptionFlag (Int
300)

-- | Allows this transaction to read and modify system keys (those that start with the byte 0xFF). Implies raw_access.
accessSystemKeys :: TransactionOption
accessSystemKeys = Int -> TransactionOption
TransactionOptionFlag (Int
301)

-- | Allows this transaction to read system keys (those that start with the byte 0xFF). Implies raw_access.
readSystemKeys :: TransactionOption
readSystemKeys = Int -> TransactionOption
TransactionOptionFlag (Int
302)

-- | Allows this transaction to access the raw key-space when tenant mode is on.
rawAccess :: TransactionOption
rawAccess = Int -> TransactionOption
TransactionOptionFlag (Int
303)

-- | 
debugDump :: TransactionOption
debugDump = Int -> TransactionOption
TransactionOptionFlag (Int
400)

-- | 
debugRetryLogging :: String -> TransactionOption
debugRetryLogging String
str = Int -> String -> TransactionOption
TransactionOptionString (Int
401) String
str

-- | Deprecated
transactionLoggingEnable :: String -> TransactionOption
transactionLoggingEnable String
str = Int -> String -> TransactionOption
TransactionOptionString (Int
402) String
str

-- | Sets a client provided identifier for the transaction that will be used in scenarios like tracing or profiling. Client trace logging or transaction profiling must be separately enabled.
debugTransactionIdentifier :: String -> TransactionOption
debugTransactionIdentifier String
str = Int -> String -> TransactionOption
TransactionOptionString (Int
403) String
str

-- | Enables tracing for this transaction and logs results to the client trace logs. The DEBUG_TRANSACTION_IDENTIFIER option must be set before using this option, and client trace logging must be enabled to get log output.
logTransaction :: TransactionOption
logTransaction = Int -> TransactionOption
TransactionOptionFlag (Int
404)

-- | 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. A negative value disables truncation.
transactionLoggingMaxFieldLength :: Int -> TransactionOption
transactionLoggingMaxFieldLength Int
i = Int -> Int -> TransactionOption
TransactionOptionInt (Int
405) Int
i

-- | Sets an identifier for server tracing of this transaction. When committed, this identifier triggers logging when each part of the transaction authority encounters it, which is helpful in diagnosing slowness in misbehaving clusters. The identifier is randomly generated. When there is also a debug_transaction_identifier, both IDs are logged together.
serverRequestTracing :: TransactionOption
serverRequestTracing = Int -> TransactionOption
TransactionOptionFlag (Int
406)

-- | Set a timeout in milliseconds which, when elapsed, will cause the transaction automatically to be cancelled. Valid parameter values are ``[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.
timeout :: Int -> TransactionOption
timeout Int
i = Int -> Int -> TransactionOption
TransactionOptionInt (Int
500) Int
i

-- | Set a maximum number of retries after which additional calls to ``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.
retryLimit :: Int -> TransactionOption
retryLimit Int
i = Int -> Int -> TransactionOption
TransactionOptionInt (Int
501) Int
i

-- | Set the maximum amount of backoff delay incurred in the call to ``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.
maxRetryDelay :: Int -> TransactionOption
maxRetryDelay Int
i = Int -> Int -> TransactionOption
TransactionOptionInt (Int
502) Int
i

-- | Set the transaction size limit in bytes. The size is calculated by combining the sizes of all keys and values written or mutated, all key ranges cleared, and all read and write conflict ranges. (In other words, it includes the total size of all data included in the request to the cluster to commit the transaction.) Large transactions can cause performance problems on FoundationDB clusters, so setting this limit to a smaller value than the default can help prevent the client from accidentally degrading the cluster's performance. This value must be at least 32 and cannot be set to higher than 10,000,000, the default transaction size limit.
sizeLimit :: Int -> TransactionOption
sizeLimit Int
i = Int -> Int -> TransactionOption
TransactionOptionInt (Int
503) Int
i

-- | Snapshot read operations will see the results of writes done in the same transaction. This is the default behavior.
snapshotRywEnable :: TransactionOption
snapshotRywEnable = Int -> TransactionOption
TransactionOptionFlag (Int
600)

-- | Snapshot read operations will not see the results of writes done in the same transaction. This was the default behavior prior to API version 300.
snapshotRywDisable :: TransactionOption
snapshotRywDisable = Int -> TransactionOption
TransactionOptionFlag (Int
601)

-- | The transaction can read and write to locked databases, and is responsible for checking that it took the lock.
lockAware :: TransactionOption
lockAware = Int -> TransactionOption
TransactionOptionFlag (Int
700)

-- | 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. This behavior is intended to help developers discover situations where operations could be unintentionally executed after the transaction has been reset. Setting this option removes that protection, causing only the offending operation to fail.
usedDuringCommitProtectionDisable :: TransactionOption
usedDuringCommitProtectionDisable = Int -> TransactionOption
TransactionOptionFlag (Int
701)

-- | The transaction can read from locked databases.
readLockAware :: TransactionOption
readLockAware = Int -> TransactionOption
TransactionOptionFlag (Int
702)

-- | No other transactions will be applied before this transaction within the same commit version.
firstInBatch :: TransactionOption
firstInBatch = Int -> TransactionOption
TransactionOptionFlag (Int
710)

-- | This option should only be used by tools which change the database configuration.
useProvisionalProxies :: TransactionOption
useProvisionalProxies = Int -> TransactionOption
TransactionOptionFlag (Int
711)

-- | The transaction can retrieve keys that are conflicting with other transactions.
reportConflictingKeys :: TransactionOption
reportConflictingKeys = Int -> TransactionOption
TransactionOptionFlag (Int
712)

-- | By default, the special key space will only allow users to read from exactly one module (a subspace in the special key space). Use this option to allow reading from zero or more modules. Users who set this option should be prepared for new modules, which may have different behaviors than the modules they're currently reading. For example, a new module might block or return an error.
specialKeySpaceRelaxed :: TransactionOption
specialKeySpaceRelaxed = Int -> TransactionOption
TransactionOptionFlag (Int
713)

-- | By default, users are not allowed to write to special keys. Enable this option will implicitly enable all options required to achieve the configuration change.
specialKeySpaceEnableWrites :: TransactionOption
specialKeySpaceEnableWrites = Int -> TransactionOption
TransactionOptionFlag (Int
714)

-- | Adds a tag to the transaction that can be used to apply manual targeted throttling. At most 5 tags can be set on a transaction.
tag :: String -> TransactionOption
tag String
str = Int -> String -> TransactionOption
TransactionOptionString (Int
800) String
str

-- | Adds a tag to the transaction that can be used to apply manual or automatic targeted throttling. At most 5 tags can be set on a transaction.
autoThrottleTag :: String -> TransactionOption
autoThrottleTag String
str = Int -> String -> TransactionOption
TransactionOptionString (Int
801) String
str

-- | Adds a parent to the Span of this transaction. Used for transaction tracing. A span can be identified with any 16 bytes
spanParent :: ByteString -> TransactionOption
spanParent ByteString
bs = Int -> ByteString -> TransactionOption
TransactionOptionBytes (Int
900) ByteString
bs

-- | Asks storage servers for how many bytes a clear key range contains. Otherwise uses the location cache to roughly estimate this.
expensiveClearCostEstimationEnable :: TransactionOption
expensiveClearCostEstimationEnable = Int -> TransactionOption
TransactionOptionFlag (Int
1000)

-- | Allows ``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.
bypassUnreadable :: TransactionOption
bypassUnreadable = Int -> TransactionOption
TransactionOptionFlag (Int
1100)

-- | Allows this transaction to use cached GRV from the database context. Defaults to off. Upon first usage, starts a background updater to periodically update the cache to avoid stale read versions.
useGrvCache :: TransactionOption
useGrvCache = Int -> TransactionOption
TransactionOptionFlag (Int
1101)

-- | Specifically instruct this transaction to NOT use cached GRV. Primarily used for the read version cache's background updater to avoid attempting to read a cached entry in specific situations.
skipGrvCache :: TransactionOption
skipGrvCache = Int -> TransactionOption
TransactionOptionFlag (Int
1102)