Skip to main content

CompactionFilterFactory

Trait CompactionFilterFactory 

Source
pub trait CompactionFilterFactory: Send + Sync {
    // Required methods
    fn create_compaction_filter(&self) -> Box<dyn CompactionFilter>;
    fn name(&self) -> &str;
}
Expand description

Creates a fresh CompactionFilter for each compaction run.

Using a factory rather than a bare filter allows the filter to hold per-compaction mutable state (e.g. a snapshot of the current time for TTL checks) without shared mutable state between concurrent compactions.

See include/rocksdb/compaction_filter.h: CompactionFilterFactory.

Required Methods§

Source

fn create_compaction_filter(&self) -> Box<dyn CompactionFilter>

Create a new filter for one compaction run.

Source

fn name(&self) -> &str

Human-readable name for logging.

Implementors§