Trait engine_rocks::raw::CompactionFilter[][src]

pub trait CompactionFilter {
    pub fn filter(
        &mut self,
        _level: usize,
        _key: &[u8],
        _value: &[u8],
        _new_value: &mut Vec<u8, Global>,
        _value_changed: &mut bool
    ) -> bool { ... }
pub fn featured_filter(
        &mut self,
        level: usize,
        key: &[u8],
        _seqno: u64,
        value: &[u8],
        value_type: CompactionFilterValueType
    ) -> CompactionFilterDecision { ... } }

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

Provided methods

pub fn filter(
    &mut self,
    _level: usize,
    _key: &[u8],
    _value: &[u8],
    _new_value: &mut Vec<u8, Global>,
    _value_changed: &mut bool
) -> bool
[src]

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.

pub fn featured_filter(
    &mut self,
    level: usize,
    key: &[u8],
    _seqno: u64,
    value: &[u8],
    value_type: CompactionFilterValueType
) -> CompactionFilterDecision
[src]

This method will overwrite filter if a CompactionFilter implements both of them.

Loading content...

Implementors

Loading content...