pub struct MetaFile { /* private fields */ }Expand description
§Safety
entries must be declared before backing so every borrowed FilterRef is dropped before
its stable mmap or heap storage.
Implementations§
Source§impl MetaFile
impl MetaFile
Sourcepub fn open(
db_path: &Path,
sequence_number: u32,
family_configs: Option<&[FamilyConfig]>,
access_mode: AccessMode,
) -> Result<Self>
pub fn open( db_path: &Path, sequence_number: u32, family_configs: Option<&[FamilyConfig]>, access_mode: AccessMode, ) -> Result<Self>
Opens a meta file using mmap or stable heap bytes according to access_mode.
pub fn clear_cache(&mut self)
pub fn prepare_sst_cache(&self)
pub fn sequence_number(&self) -> u32
pub fn family(&self) -> u32
pub fn compression(&self) -> Compression
Sourcepub fn byte_size(&self) -> u64
pub fn byte_size(&self) -> u64
The on-disk size of this meta file in bytes (the length of its memory map).
pub fn entries(&self) -> &[MetaEntry]
Sourcepub fn hash_ranges(&self) -> &[StaticSortedFileRange]
pub fn hash_ranges(&self) -> &[StaticSortedFileRange]
The hash ranges of this file’s entries, in the same order as Self::entries.
Sourcepub fn hash_range(&self, index: u32) -> StaticSortedFileRange
pub fn hash_range(&self, index: u32) -> StaticSortedFileRange
The hash range of the entry at index.
Sourcepub fn range(&self, index: u32) -> StaticSortedFileRange
pub fn range(&self, index: u32) -> StaticSortedFileRange
The key family and hash range of the entry at index.
pub fn entry(&self, index: u32) -> &MetaEntry
pub fn amqf_data(&self) -> &[u8] ⓘ
pub fn deserialize_used_key_hashes_amqf(&self) -> Result<Option<FilterRef<'_>>>
pub fn retain_entries(&mut self, predicate: impl FnMut(u32) -> bool) -> bool
pub fn obsolete_entries(&self) -> &[u32]
pub fn obsolete_sst_files(&self) -> &[u32]
Sourcepub fn lookup<K: QueryKey, const FIND_ALL: bool>(
&self,
key_family: u32,
key_hash: u64,
key: &K,
key_block_cache: &BlockCache,
value_block_cache: &BlockCache,
) -> Result<MetaLookupResult>
pub fn lookup<K: QueryKey, const FIND_ALL: bool>( &self, key_family: u32, key_hash: u64, key: &K, key_block_cache: &BlockCache, value_block_cache: &BlockCache, ) -> Result<MetaLookupResult>
Looks up a key in this meta file.
If FIND_ALL is false, returns after finding the first match.
If FIND_ALL is true, returns all entries with the same key from all SST files
(useful for keyspaces where keys are hashes and collisions are possible).
pub fn batch_lookup<K: QueryKey>( &self, key_family: u32, keys: &[K], cells: &mut [(u64, usize, Option<LookupValue>)], empty_cells: &mut usize, key_block_cache: &BlockCache, value_block_cache: &BlockCache, ) -> Result<MetaBatchLookupResult>
Auto Trait Implementations§
impl Freeze for MetaFile
impl RefUnwindSafe for MetaFile
impl Send for MetaFile
impl Sync for MetaFile
impl Unpin for MetaFile
impl UnsafeUnpin for MetaFile
impl UnwindSafe for MetaFile
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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