pub struct DeleteBitmap { /* private fields */ }Expand description
Per-segment bitmap of deleted row indices.
Wraps a roaring bitmap for O(1) membership checks and efficient serialization. Row indices are 0-based within the segment.
Implementations§
Source§impl DeleteBitmap
impl DeleteBitmap
Sourcepub fn mark_deleted(&mut self, row_idx: u32) -> bool
pub fn mark_deleted(&mut self, row_idx: u32) -> bool
Mark a row as deleted. Returns true if the row was newly deleted.
Sourcepub fn mark_deleted_batch(&mut self, row_indices: &[u32])
pub fn mark_deleted_batch(&mut self, row_indices: &[u32])
Mark multiple rows as deleted.
Sourcepub fn is_deleted(&self, row_idx: u32) -> bool
pub fn is_deleted(&self, row_idx: u32) -> bool
Check whether a row is deleted.
Sourcepub fn deleted_count(&self) -> u64
pub fn deleted_count(&self) -> u64
Number of deleted rows.
Sourcepub fn delete_ratio(&self, total_rows: u64) -> f64
pub fn delete_ratio(&self, total_rows: u64) -> f64
Delete ratio: deleted_count / total_rows. Used to trigger compaction.
Sourcepub fn should_compact(&self, total_rows: u64, threshold: f64) -> bool
pub fn should_compact(&self, total_rows: u64, threshold: f64) -> bool
Whether this segment should be compacted (delete ratio > threshold).
Sourcepub fn is_block_fully_deleted(&self, block_start: u32, block_len: u32) -> bool
pub fn is_block_fully_deleted(&self, block_start: u32, block_len: u32) -> bool
Check whether an entire block is fully deleted.
block_start is the first row index of the block, block_len is
the number of rows. Returns true if every row in the range is deleted.
Sourcepub fn apply_to_validity(&self, valid: &mut [bool], global_offset: u32)
pub fn apply_to_validity(&self, valid: &mut [bool], global_offset: u32)
Apply the delete bitmap to a validity vector: set deleted rows to false.
global_offset is the row index of the first element in valid
(used when processing a block that starts at a non-zero row).
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>, ColumnarError>
pub fn to_bytes(&self) -> Result<Vec<u8>, ColumnarError>
Serialize the bitmap to bytes for persistence.
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, ColumnarError>
pub fn from_bytes(data: &[u8]) -> Result<Self, ColumnarError>
Deserialize a bitmap from bytes.
Sourcepub fn merge(&mut self, other: &DeleteBitmap)
pub fn merge(&mut self, other: &DeleteBitmap)
Merge another bitmap into this one (union). Used during compaction to combine delete bitmaps from multiple source segments.
Trait Implementations§
Source§impl Clone for DeleteBitmap
impl Clone for DeleteBitmap
Source§fn clone(&self) -> DeleteBitmap
fn clone(&self) -> DeleteBitmap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeleteBitmap
impl Debug for DeleteBitmap
Auto Trait Implementations§
impl Freeze for DeleteBitmap
impl RefUnwindSafe for DeleteBitmap
impl Send for DeleteBitmap
impl Sync for DeleteBitmap
impl Unpin for DeleteBitmap
impl UnsafeUnpin for DeleteBitmap
impl UnwindSafe for DeleteBitmap
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.