Struct rocksdb::TransactionDBOptions
source · pub struct TransactionDBOptions { /* private fields */ }
Implementations§
source§impl TransactionDBOptions
impl TransactionDBOptions
pub fn new() -> TransactionDBOptions
sourcepub fn set_default_lock_timeout(&mut self, default_lock_timeout: i64)
pub fn set_default_lock_timeout(&mut self, default_lock_timeout: i64)
Specifies the wait timeout in milliseconds when writing a key
outside a transaction (i.e. by calling TransactionDB::put
directly).
If 0, no waiting is done if a lock cannot instantly be acquired. If negative, there is no timeout and will block indefinitely when acquiring a lock.
Not using a timeout can lead to deadlocks. Currently, there is no deadlock-detection to recover from a deadlock. While DB writes cannot deadlock with other DB writes, they can deadlock with a transaction. A negative timeout should only be used if all transactions have a small expiration set.
Default: 1000(1s).
sourcepub fn set_txn_lock_timeout(&mut self, txn_lock_timeout: i64)
pub fn set_txn_lock_timeout(&mut self, txn_lock_timeout: i64)
Specifies the default wait timeout in milliseconds when a transaction
attempts to lock a key if not specified in TransactionOptions
.
If 0, no waiting is done if a lock cannot instantly be acquired. If negative, there is no timeout. Not using a timeout is not recommended as it can lead to deadlocks. Currently, there is no deadlock-detection to recover from a deadlock.
Default: 1000(1s).
sourcepub fn set_max_num_locks(&mut self, max_num_locks: i64)
pub fn set_max_num_locks(&mut self, max_num_locks: i64)
Specifies the maximum number of keys that can be locked at the same time per column family.
If the number of locked keys is greater than max_num_locks
, transaction
writes
(or get_for_update
) will return an error.
If this value is not positive, no limit will be enforced.
Default: -1.
sourcepub fn set_num_stripes(&mut self, num_stripes: usize)
pub fn set_num_stripes(&mut self, num_stripes: usize)
Specifies lock table stripes count.
Increasing this value will increase the concurrency by dividing the lock table (per column family) into more sub-tables, each with their own separate mutex.
Default: 16.