pub struct Segment {
pub metadata: Metadata,
/* private fields */
}
Expand description
Disk segment (a.k.a. SSTable
, SST
, sorted string table
) that is located on disk
A segment is an immutable list of key-value pairs, split into compressed blocks.
A reference to the block (block handle
) is saved in the “block index”.
Deleted entries are represented by tombstones.
Segments can be merged together to remove duplicate items, reducing disk space and improving read performance.
Fields§
§metadata: Metadata
Segment metadata object
Implementations§
source§impl Segment
impl Segment
sourcepub fn recover<P: AsRef<Path>>(
file_path: P,
tree_id: TreeId,
block_cache: Arc<BlockCache>,
descriptor_table: Arc<FileDescriptorTable>
) -> Result<Self>
pub fn recover<P: AsRef<Path>>( file_path: P, tree_id: TreeId, block_cache: Arc<BlockCache>, descriptor_table: Arc<FileDescriptorTable> ) -> Result<Self>
Tries to recover a segment from a file.
sourcepub fn tombstone_count(&self) -> u64
pub fn tombstone_count(&self) -> u64
Returns the amount of tombstone markers in the Segment
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnwindSafe for Segment
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