pub struct CompactReport {
pub sources: Vec<u32>,
pub merged_segment_id: Option<u32>,
pub merged_segment_bytes: Vec<u8>,
pub merged_rows: usize,
pub deleted_rows_pruned: usize,
pub bytes_reclaimed_estimate: u64,
}Expand description
v6.7.3 — outcome of a Catalog::compact_cold_segments call.
The catalog state has already been mutated when this is returned:
the merged segment is loaded into cold_segments, the source
segment slots are tombstoned (None), and every BTree-index
RowLocator::Cold that previously pointed at a source now
points at the merged segment. The caller’s remaining job is to
persist merged_segment_bytes under
<db>.spg/segments/seg_<merged_segment_id>.spg and update the
in-memory segment_id → path map (remove the source ids, add
the merged id) so the next CHECKPOINT writes a manifest that
no longer lists the retired sources.
On a no-op (fewer than 2 candidate segments under the threshold),
merged_segment_id is None and sources is empty; the
catalog was not mutated.
Fields§
§sources: Vec<u32>Source segment ids that were merged + tombstoned.
merged_segment_id: Option<u32>Id allocated for the merged segment. None on no-op.
merged_segment_bytes: Vec<u8>Encoded merged-segment bytes (empty on no-op).
merged_rows: usizeNumber of rows that landed in the merged segment.
deleted_rows_pruned: usizeΣ source.num_rows − merged_rows. Rows present in source
segment payloads but unreferenced by any live BTree
Cold locator — DELETE’d-but-still-frozen rows that
compaction GC’d during the merge.
bytes_reclaimed_estimate: u64Σ source.bytes() − merged.bytes(). Estimate of on-disk
space the merge will reclaim once the source segment files
are GC’d. Saturating subtract — never negative.
Trait Implementations§
Source§impl Clone for CompactReport
impl Clone for CompactReport
Source§fn clone(&self) -> CompactReport
fn clone(&self) -> CompactReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more