pub enum OccValidationPolicy {
ValidateSerial = 0,
ValidateParallel = 1,
}Expand description
How an OptimisticTransactionDB checks a transaction for write conflicts at commit.
Variants§
ValidateSerial = 0
Validate serially at commit, after the transaction has entered the write group.
Validation is single threaded because the write group is. Simple, but it can suffer from high mutex contention. See https://github.com/facebook/rocksdb/issues/4402.
ValidateParallel = 1
Validate in parallel before the transaction enters the write group.
Each transaction takes locks for its write set in a well defined order, off the
write group, which cuts the mutex contention. This is the default. The locks come
from the pool sized by OptimisticTransactionDBOptions::set_occ_lock_buckets
or supplied by OptimisticTransactionDBOptions::set_shared_lock_buckets.
Trait Implementations§
Source§impl Clone for OccValidationPolicy
impl Clone for OccValidationPolicy
Source§fn clone(&self) -> OccValidationPolicy
fn clone(&self) -> OccValidationPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for OccValidationPolicy
Source§impl Debug for OccValidationPolicy
impl Debug for OccValidationPolicy
Source§impl<'de> Deserialize<'de> for OccValidationPolicy
Available on crate feature serde1 only.
impl<'de> Deserialize<'de> for OccValidationPolicy
Available on crate feature
serde1 only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for OccValidationPolicy
Source§impl PartialEq for OccValidationPolicy
impl PartialEq for OccValidationPolicy
Source§impl Serialize for OccValidationPolicy
Available on crate feature serde1 only.
impl Serialize for OccValidationPolicy
Available on crate feature
serde1 only.impl StructuralPartialEq for OccValidationPolicy
Auto Trait Implementations§
impl Freeze for OccValidationPolicy
impl RefUnwindSafe for OccValidationPolicy
impl Send for OccValidationPolicy
impl Sync for OccValidationPolicy
impl Unpin for OccValidationPolicy
impl UnsafeUnpin for OccValidationPolicy
impl UnwindSafe for OccValidationPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more