pub struct CowCompactor {
pub strip_unknown: bool,
}Expand description
COW-aware compaction engine.
Fields§
§strip_unknown: boolWhether to strip unknown segment types during compaction.
Implementations§
Source§impl CowCompactor
impl CowCompactor
Sourcepub fn compact_read_optimize(
cow_map: &mut CowMap,
local_data: &HashMap<u32, Vec<u8>>,
cluster_size: u32,
) -> Result<CompactionResult, RvfError>
pub fn compact_read_optimize( cow_map: &mut CowMap, local_data: &HashMap<u32, Vec<u8>>, cluster_size: u32, ) -> Result<CompactionResult, RvfError>
Read-optimize compaction: reorder local clusters for sequential read.
Scans the COW map, reads all LocalOffset clusters, and rewrites them contiguously in cluster_id order. Updates the map entries to point to the new contiguous offsets.
Sourcepub fn compact_space_reclaim(
cow_map: &mut CowMap,
local_data: &HashMap<u32, Vec<u8>>,
parent_data: &HashMap<u32, Vec<u8>>,
cluster_size: u32,
) -> Result<CompactionResult, RvfError>
pub fn compact_space_reclaim( cow_map: &mut CowMap, local_data: &HashMap<u32, Vec<u8>>, parent_data: &HashMap<u32, Vec<u8>>, cluster_size: u32, ) -> Result<CompactionResult, RvfError>
Space-reclaim compaction: if local cluster data matches parent data, replace LocalOffset with ParentRef to reclaim space.
Sourcepub fn rebuild_refcounts(cow_map: &CowMap) -> RefcountData
pub fn rebuild_refcounts(cow_map: &CowMap) -> RefcountData
Rebuild reference counts from the COW map.
Each LocalOffset cluster has refcount 1. ParentRef clusters increment the parent’s refcount.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CowCompactor
impl RefUnwindSafe for CowCompactor
impl Send for CowCompactor
impl Sync for CowCompactor
impl Unpin for CowCompactor
impl UnwindSafe for CowCompactor
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