Commit 9fbf6202 authored by zhangjinpeng1987's avatar zhangjinpeng1987

add set_cache_index_and_filter_blocks

parent cb11b928
...@@ -17,7 +17,7 @@ extern crate libc; ...@@ -17,7 +17,7 @@ extern crate libc;
#[cfg(test)] #[cfg(test)]
extern crate tempdir; extern crate tempdir;
use libc::{c_char, c_int, c_void, size_t, uint64_t}; use libc::{c_char, c_uchar, c_int, c_void, size_t, uint64_t};
use std::ffi::CStr; use std::ffi::CStr;
use std::str::from_utf8; use std::str::from_utf8;
...@@ -124,6 +124,8 @@ extern "C" { ...@@ -124,6 +124,8 @@ extern "C" {
pub fn rocksdb_block_based_options_set_block_restart_interval( pub fn rocksdb_block_based_options_set_block_restart_interval(
block_options: DBBlockBasedTableOptions, block_options: DBBlockBasedTableOptions,
block_restart_interval: c_int); block_restart_interval: c_int);
pub fn rocksdb_block_based_options_set_cache_index_and_filter_blocks(
block_options: DBBlockBasedTableOptions, v: c_uchar);
pub fn rocksdb_block_based_options_set_filter_policy( pub fn rocksdb_block_based_options_set_filter_policy(
block_options: DBBlockBasedTableOptions, block_options: DBBlockBasedTableOptions,
filter_policy: DBFilterPolicy); filter_policy: DBFilterPolicy);
......
...@@ -121,6 +121,13 @@ impl BlockBasedOptions { ...@@ -121,6 +121,13 @@ impl BlockBasedOptions {
filter.inner); filter.inner);
} }
} }
pub fn set_cache_index_and_filter_blocks(&mut self, v: bool) {
unsafe {
rocksdb_ffi::rocksdb_block_based_options_set_cache_index_and_filter_blocks(self.inner,
v as u8);
}
}
} }
// TODO figure out how to create these in a Rusty way // TODO figure out how to create these in a Rusty way
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment