#[non_exhaustive]
#[derive(Debug, Clone, Copy)]
pub struct CompactBudget {
pub max_pages_relocated: u64,
pub max_duration_ms: u64,
}
impl Default for CompactBudget {
fn default() -> Self {
Self {
max_pages_relocated: 256,
max_duration_ms: 500,
}
}
}
impl CompactBudget {
#[must_use]
pub fn new(max_pages_relocated: u64, max_duration_ms: u64) -> Self {
Self {
max_pages_relocated,
max_duration_ms,
}
}
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, Default)]
pub struct CompactProgress {
pub pages_relocated: u64,
pub bytes_freed: u64,
pub more_work: bool,
pub watermark: Option<u64>,
}
#[non_exhaustive]
#[derive(Debug, Clone, Copy, Default)]
pub struct CompactStats {
pub main_db_pages_reclaimed: u64,
pub segments_repacked: u32,
pub bytes_truncated: u64,
}