pub struct ValueLog { /* private fields */ }Expand description
Value log for storing large values
Implementations§
Source§impl ValueLog
impl ValueLog
Sourcepub fn new(vlog_dir: impl AsRef<Path>) -> Result<Self>
pub fn new(vlog_dir: impl AsRef<Path>) -> Result<Self>
Create a new value log with default configuration
Sourcepub fn with_config(config: ValueLogConfig) -> Result<Self>
pub fn with_config(config: ValueLogConfig) -> Result<Self>
Create a new value log with custom configuration
Sourcepub fn should_separate(&self, value: &CipherBlob) -> bool
pub fn should_separate(&self, value: &CipherBlob) -> bool
Check if a value should be stored in vLog
Sourcepub fn append(&self, key: Key, value: CipherBlob) -> Result<ValuePointer>
pub fn append(&self, key: Key, value: CipherBlob) -> Result<ValuePointer>
Append a value to the vLog and return a pointer
Sourcepub fn read(&self, pointer: &ValuePointer) -> Result<CipherBlob>
pub fn read(&self, pointer: &ValuePointer) -> Result<CipherBlob>
Read a value from the vLog using a pointer
Sourcepub fn current_file_id(&self) -> u64
pub fn current_file_id(&self) -> u64
Get current file ID
Sourcepub fn config(&self) -> &ValueLogConfig
pub fn config(&self) -> &ValueLogConfig
Get configuration
Sourcepub fn garbage_collect<F>(&self, file_id: u64, is_live_fn: F) -> Result<GcStats>
pub fn garbage_collect<F>(&self, file_id: u64, is_live_fn: F) -> Result<GcStats>
Perform garbage collection on a vLog file
Scans the file and rewrites live values to a new file, discarding dead values. This is typically called when a file has too much garbage.
is_live_fn: Function that checks if a key is still live in the LSM-Tree
Auto Trait Implementations§
impl Freeze for ValueLog
impl !RefUnwindSafe for ValueLog
impl Send for ValueLog
impl Sync for ValueLog
impl Unpin for ValueLog
impl !UnwindSafe for ValueLog
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> 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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.