pub struct OptimisticTransactionDBOptions { /* private fields */ }Expand description
Options for opening an OptimisticTransactionDB.
These control conflict validation only. Everything else about the database still
comes from Options, which is passed alongside these to the open call.
Implementations§
Source§impl OptimisticTransactionDBOptions
impl OptimisticTransactionDBOptions
pub fn new() -> OptimisticTransactionDBOptions
Sourcepub fn set_validate_policy(&mut self, policy: OccValidationPolicy)
pub fn set_validate_policy(&mut self, policy: OccValidationPolicy)
Specifies how transactions are checked for write conflicts at commit.
Default: OccValidationPolicy::ValidateParallel.
Sourcepub fn get_validate_policy(&self) -> Option<OccValidationPolicy>
pub fn get_validate_policy(&self) -> Option<OccValidationPolicy>
The validation policy set by Self::set_validate_policy.
OccValidationPolicy covers every policy RocksDB defines today, so None only
shows up if a future release adds one.
Sourcepub fn set_occ_lock_buckets(&mut self, num_buckets: u32)
pub fn set_occ_lock_buckets(&mut self, num_buckets: u32)
Specifies how many striped mutex locks to allocate for validating transactions.
Only used when the validation policy is
OccValidationPolicy::ValidateParallel and no pool was supplied through
Self::set_shared_lock_buckets. A larger count potentially reduces contention
but uses more memory.
Default: 1048576 (1 << 20).
Sourcepub fn get_occ_lock_buckets(&self) -> u32
pub fn get_occ_lock_buckets(&self) -> u32
Returns the value of the occ_lock_buckets option.
Validates against buckets instead of a pool private to this database.
Give the same OccLockBuckets to several databases and they share one set of
locks, which bounds the total memory spent on validation. Ignored unless the
validation policy is OccValidationPolicy::ValidateParallel, and it overrides
Self::set_occ_lock_buckets when set.
These options take their own reference to the pool, so buckets may be dropped
as soon as this returns.