Add set_memtable_prefix_bloom_ratio

master
Martin Ek 6 years ago
parent 701669d076
commit b3559793aa
  1. 22
      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 {

Loading…
Cancel
Save