CompactionStrategy

Trait CompactionStrategy 

Source
pub trait CompactionStrategy {
    // Required methods
    fn get_name(&self) -> &'static str;
    fn choose(
        &self,
        version: &Version,
        config: &Config,
        state: &CompactionState,
    ) -> Choice;
}
Expand description

Trait for a compaction strategy

The strategy receives the levels of the LSM-tree as argument and emits a choice on what to do.

Required Methods§

Source

fn get_name(&self) -> &'static str

Gets the compaction strategy name.

Source

fn choose( &self, version: &Version, config: &Config, state: &CompactionState, ) -> Choice

Decides on what to do based on the current state of the LSM-tree’s levels

Implementors§

Source§

impl CompactionStrategy for lsm_tree::compaction::Fifo

Source§

impl CompactionStrategy for lsm_tree::compaction::Leveled