pub struct Segment {
pub metadata: Metadata,
/* private fields */
}
Expand description
Disk segment (a.k.a. SSTable
, sorted string table
) that is located on disk
A segment is an immutable list of key-value pairs, split into compressed blocks (see [block::ValueBlock
]).
The block offset and size in the file is saved in the “block index”.
Deleted entries are represented by tombstones.
Segments can be merged together to remove duplicates, reducing disk space and improving read performance.
Fields§
§metadata: Metadata
Segment metadata object (will be stored in a JSON file)
Implementations§
source§impl Segment
impl Segment
sourcepub fn recover<P: AsRef<Path>>(
folder: P,
block_cache: Arc<BlockCache>,
descriptor_table: Arc<FileDescriptorTable>
) -> Result<Self>
pub fn recover<P: AsRef<Path>>( folder: P, block_cache: Arc<BlockCache>, descriptor_table: Arc<FileDescriptorTable> ) -> Result<Self>
Tries to recover a segment from a folder.
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 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