add report_gb_io_stats option

master
jinpeng zhang 9 years ago committed by Karl Hobley
parent 0dfdc06ddf
commit a783093048
  1. 1
      src/ffi.rs
  2. 10
      src/rocksdb_options.rs

@ -189,6 +189,7 @@ extern "C" {
pub fn rocksdb_options_set_filter_deletes(options: DBOptions, v: bool); pub fn rocksdb_options_set_filter_deletes(options: DBOptions, v: bool);
pub fn rocksdb_options_set_disable_auto_compactions(options: DBOptions, pub fn rocksdb_options_set_disable_auto_compactions(options: DBOptions,
v: c_int); v: c_int);
pub fn rocksdb_options_set_report_bg_io_stats(options: DBOptions, v: c_int);
pub fn rocksdb_filterpolicy_create_bloom(bits_per_key: c_int) pub fn rocksdb_filterpolicy_create_bloom(bits_per_key: c_int)
-> DBFilterPolicy; -> DBFilterPolicy;
pub fn rocksdb_open(options: DBOptions, pub fn rocksdb_open(options: DBOptions,

@ -315,6 +315,16 @@ impl Options {
rocksdb_ffi::rocksdb_options_set_block_based_table_factory(self.inner, factory.inner); rocksdb_ffi::rocksdb_options_set_block_based_table_factory(self.inner, factory.inner);
} }
} }
pub fn set_report_bg_io_stats(&mut self, enable: bool) {
unsafe {
if enable {
rocksdb_ffi::rocksdb_options_set_report_bg_io_stats(self.inner, 1);
} else {
rocksdb_ffi::rocksdb_options_set_report_bg_io_stats(self.inner, 0);
}
}
}
} }
impl Default for Options { impl Default for Options {

Loading…
Cancel
Save