diff --git a/src/db_options.rs b/src/db_options.rs index 716b6f7..cf8ba78 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -980,6 +980,28 @@ impl Options { ffi::rocksdb_options_set_num_levels(self.inner, n); } } + + /// When a `prefix_extractor` is defined through `opts.set_prefix_extractor` this creates a + /// prefix bloom filter for each memtable with the size of + /// `write_buffer_size * memtable_prefix_bloom_ratio` (capped at 0.25). + /// + /// Default: `0` + /// + /// # Example + /// + /// ``` + /// use rocksdb::{Options, SliceTransform}; + /// + /// let mut opts = Options::default(); + /// let transform = SliceTransform::create_fixed_prefix(10); + /// opts.set_prefix_extractor(transform); + /// opts.set_memtable_prefix_bloom_ratio(0.2); + /// ``` + pub fn set_memtable_prefix_bloom_ratio(&mut self, ratio: f64) { + unsafe { + ffi::rocksdb_options_set_memtable_prefix_bloom_size_ratio(self.inner, ratio); + } + } } impl Default for Options {