From d82d5c6b77ab15dbeb504d8318ab055f7292ab23 Mon Sep 17 00:00:00 2001 From: Martin Ek Date: Wed, 2 May 2018 23:04:53 +0200 Subject: [PATCH] Add plain table format --- src/db_options.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/db_options.rs b/src/db_options.rs index 925eb5a..d4d2fc1 100644 --- a/src/db_options.rs +++ b/src/db_options.rs @@ -982,6 +982,26 @@ impl Options { } } + // See https://github.com/facebook/rocksdb/wiki/PlainTable-Format. + // + // Defaults: + // user_key_len: 0 (variable length) + // bloom_bits_per_key: 10 + // has_table_ratio: 0.75 + // index_sparseness: 16 + pub fn set_plain_table_factory(&mut self, user_key_len: u32, bloom_bits_per_key: i32, + hash_table_ratio: f64, index_sparseness: usize) { + unsafe { + ffi::rocksdb_options_set_plain_table_factory( + self.inner, + user_key_len, + bloom_bits_per_key, + hash_table_ratio, + index_sparseness, + ); + } + } + /// Measure IO stats in compactions and flushes, if `true`. /// /// Default: `false`