pub enum TxnDBWritePolicy {
WriteCommitted = 0,
WritePrepared = 1,
WriteUnprepared = 2,
}Expand description
When a TransactionDB writes transaction data into the DB.
TransactionDB reads this once while opening, to choose which implementation to
build, and keeps its own copy. Changing it on a TransactionDBOptions afterwards
has no effect on a DB that is already open.
Variants§
WriteCommitted = 0
Write data at commit time.
Only committed data ever reaches the DB, so readers need no extra machinery to tell committed from uncommitted. This is the default.
WritePrepared = 1
Write data after the prepare phase of two-phase commit.
Data lands before the commit, so the DB has to track which of it is committed and
readers have to consult that. Experimental: RocksDB describes the non-committed
policies as less mature, less validated and less compatible with other features
than WriteCommitted.
WriteUnprepared = 2
Write data before the prepare phase of two-phase commit.
A running transaction can flush its pending writes into the DB once its batch
crosses
TransactionDBOptions::set_default_write_batch_flush_threshold, which keeps
memory bounded for very large transactions. Experimental, and the least mature of
the three.
Trait Implementations§
Source§impl Clone for TxnDBWritePolicy
impl Clone for TxnDBWritePolicy
Source§fn clone(&self) -> TxnDBWritePolicy
fn clone(&self) -> TxnDBWritePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TxnDBWritePolicy
Source§impl Debug for TxnDBWritePolicy
impl Debug for TxnDBWritePolicy
Source§impl<'de> Deserialize<'de> for TxnDBWritePolicy
Available on crate feature serde1 only.
impl<'de> Deserialize<'de> for TxnDBWritePolicy
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>,
impl Eq for TxnDBWritePolicy
Source§impl PartialEq for TxnDBWritePolicy
impl PartialEq for TxnDBWritePolicy
Source§impl Serialize for TxnDBWritePolicy
Available on crate feature serde1 only.
impl Serialize for TxnDBWritePolicy
serde1 only.