From f781adc84b81fe2e848420043e41af298008ffa7 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 25 Apr 2016 03:36:19 +0800 Subject: [PATCH] add allow os buffer conf --- src/ffi.rs | 1 + src/rocksdb_options.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/ffi.rs b/src/ffi.rs index 99ff01f..5045d2f 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -147,6 +147,7 @@ extern "C" { pub fn rocksdb_options_set_bytes_per_sync(options: DBOptions, bytes: u64); pub fn rocksdb_options_set_disable_data_sync(options: DBOptions, v: c_int); + pub fn rocksdb_options_set_allow_os_buffer(options: DBOptions, is_allow: bool); pub fn rocksdb_options_optimize_for_point_lookup(options: DBOptions, block_cache_size_mb: u64); pub fn rocksdb_options_set_table_cache_numshardbits(options: DBOptions, diff --git a/src/rocksdb_options.rs b/src/rocksdb_options.rs index f45a4e3..6b16265 100644 --- a/src/rocksdb_options.rs +++ b/src/rocksdb_options.rs @@ -195,6 +195,13 @@ impl Options { } } + pub fn allow_os_buffer(&mut self, is_allow: bool) { + unsafe { + rocksdb_ffi::rocksdb_options_set_allow_os_buffer(self.inner, + is_allow); + } + } + pub fn set_table_cache_num_shard_bits(&mut self, nbits: c_int) { unsafe { rocksdb_ffi::rocksdb_options_set_table_cache_numshardbits(self.inner,