Struct rocksdb::TransactionDBOptions

source ·
pub struct TransactionDBOptions { /* private fields */ }

Implementations§

source§

impl TransactionDBOptions

source

pub fn new() -> TransactionDBOptions

source

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).

source

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).

source

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.

source

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.

Trait Implementations§

source§

impl Default for TransactionDBOptions

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Drop for TransactionDBOptions

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for TransactionDBOptions

source§

impl Sync for TransactionDBOptions

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.