pub struct AsyncSSTableReader<V: SSTableValue> { /* private fields */ }Expand description
Async SSTable reader - loads blocks on demand via LazyFileSlice
Implementations§
Source§impl<V: SSTableValue> AsyncSSTableReader<V>
impl<V: SSTableValue> AsyncSSTableReader<V>
Sourcepub async fn open(
file_handle: LazyFileHandle,
cache_blocks: usize,
) -> Result<Self>
pub async fn open( file_handle: LazyFileHandle, cache_blocks: usize, ) -> Result<Self>
Open an SSTable from a LazyFileHandle Only loads the footer and index into memory, data blocks fetched on-demand
Sourcepub fn num_entries(&self) -> u64
pub fn num_entries(&self) -> u64
Number of entries
Sourcepub fn stats(&self) -> SSTableStats
pub fn stats(&self) -> SSTableStats
Get stats about this SSTable for debugging
Sourcepub async fn get(&self, key: &[u8]) -> Result<Option<V>>
pub async fn get(&self, key: &[u8]) -> Result<Option<V>>
Look up a key (async - may need to load block)
Uses bloom filter for fast negative lookups, then sparse index to narrow search range before binary search, reducing I/O to typically 1 block read.
Sourcepub async fn get_batch(&self, keys: &[&[u8]]) -> Result<Vec<Option<V>>>
pub async fn get_batch(&self, keys: &[&[u8]]) -> Result<Vec<Option<V>>>
Batch lookup multiple keys with optimized I/O
Groups keys by block and loads each block only once, reducing I/O from N reads to at most N reads (often fewer if keys share blocks). Uses bloom filter to skip keys that definitely don’t exist.
Sourcepub async fn preload_all_blocks(&self) -> Result<()>
pub async fn preload_all_blocks(&self) -> Result<()>
Preload all data blocks into memory
Call this after open() to eliminate all I/O during subsequent lookups. Useful when the SSTable is small enough to fit in memory.
Sourcepub async fn prefetch_range(
&self,
start_key: &[u8],
end_key: &[u8],
) -> Result<()>
pub async fn prefetch_range( &self, start_key: &[u8], end_key: &[u8], ) -> Result<()>
Prefetch blocks for a key range
Auto Trait Implementations§
impl<V> !Freeze for AsyncSSTableReader<V>
impl<V> !RefUnwindSafe for AsyncSSTableReader<V>
impl<V> Send for AsyncSSTableReader<V>
impl<V> Sync for AsyncSSTableReader<V>
impl<V> Unpin for AsyncSSTableReader<V>where
V: Unpin,
impl<V> !UnwindSafe for AsyncSSTableReader<V>
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
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>
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>
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> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.