pub struct VersionStore { /* private fields */ }Expand description
Lock-free version store using DashMap
Provides O(1) key lookup + O(log V) version lookup per key.
Implementations§
Source§impl VersionStore
impl VersionStore
Sourcepub fn insert_uncommitted(
&self,
key: &[u8],
value: Option<Vec<u8>>,
txn_id: u64,
epoch: u32,
) -> Result<()>
pub fn insert_uncommitted( &self, key: &[u8], value: Option<Vec<u8>>, txn_id: u64, epoch: u32, ) -> Result<()>
Insert a new uncommitted version
Sourcepub fn get(
&self,
key: &[u8],
snapshot_ts: u64,
current_txn_id: Option<u64>,
) -> Option<Vec<u8>>
pub fn get( &self, key: &[u8], snapshot_ts: u64, current_txn_id: Option<u64>, ) -> Option<Vec<u8>>
Read value at snapshot timestamp
Sourcepub fn gc(&self, min_epoch: u32, min_snapshot_ts: u64) -> usize
pub fn gc(&self, min_epoch: u32, min_snapshot_ts: u64) -> usize
Run garbage collection
Removes old versions that are no longer visible to any reader.
Sourcepub fn stats(&self) -> &VersionStoreStats
pub fn stats(&self) -> &VersionStoreStats
Get statistics
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for VersionStore
impl !RefUnwindSafe for VersionStore
impl Send for VersionStore
impl Sync for VersionStore
impl Unpin for VersionStore
impl UnwindSafe for VersionStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more