[][src]Trait rexrocksdb::CompactionFilter

pub trait CompactionFilter {
    fn filter(&mut self, level: usize, key: &[u8], value: &[u8]) -> bool;
}

CompactionFilter allows an application to modify/delete a key-value at the time of compaction. For more details, Please checkout rocksdb's documentation.

Required methods

fn filter(&mut self, level: usize, key: &[u8], value: &[u8]) -> bool

The compaction process invokes this method for kv that is being compacted. A return value of false indicates that the kv should be preserved in the output of this compaction run and a return value of true indicates that this key-value should be removed from the output of the compaction. The application can inspect the existing value of the key and make decision based on it.

Loading content...

Implementors

Loading content...