use super::VamanaSSTFile;
#[derive(Debug, Clone)]
pub struct CompactionTrigger {
pub l1_threshold: usize,
}
impl Default for CompactionTrigger {
fn default() -> Self {
Self {
l1_threshold: 4, }
}
}
pub struct CompactionStrategy {
config: CompactionTrigger,
}
impl CompactionStrategy {
pub fn new(config: CompactionTrigger) -> Self {
Self { config }
}
pub fn should_compact(&self, l1_ssts: &[VamanaSSTFile]) -> bool {
l1_ssts.len() >= self.config.l1_threshold
}
}