pub struct SsTable { /* private fields */ }Expand description
An SSTable.
Implementations§
Source§impl SsTable
impl SsTable
Sourcepub fn open(
id: usize,
block_cache: Option<Arc<BlockCache>>,
file: FileObject,
) -> Result<Self>
pub fn open( id: usize, block_cache: Option<Arc<BlockCache>>, file: FileObject, ) -> Result<Self>
Open SSTable from a file.
Sourcepub fn create_meta_only(
id: usize,
file_size: u64,
first_key: KeyBytes,
last_key: KeyBytes,
) -> Self
pub fn create_meta_only( id: usize, file_size: u64, first_key: KeyBytes, last_key: KeyBytes, ) -> Self
Create a mock SST with only first key + last key metadata
Sourcepub fn read_block_cached(&self, block_idx: usize) -> Result<Arc<Block>>
pub fn read_block_cached(&self, block_idx: usize) -> Result<Arc<Block>>
Read a block from disk, with block cache.
Sourcepub fn find_block_idx(&self, key: KeySlice<'_>) -> usize
pub fn find_block_idx(&self, key: KeySlice<'_>) -> usize
Find the block that may contain key.
Sourcepub fn num_of_blocks(&self) -> usize
pub fn num_of_blocks(&self) -> usize
Get number of data blocks.
pub fn first_key(&self) -> &KeyBytes
pub fn last_key(&self) -> &KeyBytes
pub fn table_size(&self) -> u64
pub fn sst_id(&self) -> usize
pub fn max_ts(&self) -> u64
Auto Trait Implementations§
impl !Freeze for SsTable
impl !RefUnwindSafe for SsTable
impl Send for SsTable
impl Sync for SsTable
impl Unpin for SsTable
impl !UnwindSafe for SsTable
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