risingwave_storage::hummock::sstable

Trait FilterBuilder

source
pub trait FilterBuilder: Send {
    // Required methods
    fn add_key(&mut self, dist_key: &[u8], table_id: u32);
    fn finish(&mut self, memory_limiter: Option<Arc<MemoryLimiter>>) -> Vec<u8> ;
    fn approximate_len(&self) -> usize;
    fn create(fpr: f64, capacity: usize) -> Self;
    fn approximate_building_memory(&self) -> usize;

    // Provided methods
    fn switch_block(&mut self, _memory_limiter: Option<Arc<MemoryLimiter>>) { ... }
    fn add_raw_data(&mut self, _raw: Vec<u8>) { ... }
    fn support_blocked_raw_data(&self) -> bool { ... }
}

Required Methods§

source

fn add_key(&mut self, dist_key: &[u8], table_id: u32)

add key which need to be filter for construct filter data.

source

fn finish(&mut self, memory_limiter: Option<Arc<MemoryLimiter>>) -> Vec<u8>

Builds Bloom filter from key hashes

source

fn approximate_len(&self) -> usize

approximate memory of filter builder

source

fn create(fpr: f64, capacity: usize) -> Self

source

fn approximate_building_memory(&self) -> usize

approximate memory when finish filter

Provided Methods§

source

fn switch_block(&mut self, _memory_limiter: Option<Arc<MemoryLimiter>>)

source

fn add_raw_data(&mut self, _raw: Vec<u8>)

Add raw data which build by keys directly. Please make sure that you have finished the last block by calling switch_block

source

fn support_blocked_raw_data(&self) -> bool

Object Safety§

This trait is not object safe.

Implementors§