Commit 8580183e authored by Li Shihai's avatar Li Shihai Committed by siddontang

export writable_file_max_buffer_size option (#56)

parent 79c27a41
......@@ -1966,6 +1966,11 @@ void crocksdb_options_set_table_cache_numshardbits(
opt->rep.table_cache_numshardbits = v;
}
void crocksdb_options_set_writable_file_max_buffer_size(
crocksdb_options_t* opt, int v) {
opt->rep.writable_file_max_buffer_size = v;
}
void crocksdb_options_set_table_cache_remove_scan_count_limit(
crocksdb_options_t* opt, int v) {
// this option is deprecated
......
......@@ -703,6 +703,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_max_manifest_file_size(
crocksdb_options_t*, size_t);
extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_table_cache_numshardbits(
crocksdb_options_t*, int);
extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_writable_file_max_buffer_size(
crocksdb_options_t*, int);
extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_table_cache_remove_scan_count_limit(crocksdb_options_t*,
int);
......
......@@ -220,6 +220,7 @@ extern "C" {
pub fn crocksdb_options_optimize_for_point_lookup(options: *mut DBOptions,
block_cache_size_mb: u64);
pub fn crocksdb_options_set_table_cache_numshardbits(options: *mut DBOptions, bits: c_int);
pub fn crocksdb_options_set_writable_file_max_buffer_size(options: *mut DBOptions, nbytes: c_int);
pub fn crocksdb_options_set_max_write_buffer_number(options: *mut DBOptions, bufno: c_int);
pub fn crocksdb_options_set_min_write_buffer_number_to_merge(options: *mut DBOptions,
bufno: c_int);
......
......@@ -467,6 +467,12 @@ impl Options {
}
}
pub fn set_writable_file_max_buffer_size(&mut self, nbytes: c_int) {
unsafe {
crocksdb_ffi::crocksdb_options_set_writable_file_max_buffer_size(self.inner, nbytes);
}
}
pub fn set_min_write_buffer_number(&mut self, nbuf: c_int) {
unsafe {
crocksdb_ffi::crocksdb_options_set_min_write_buffer_number_to_merge(self.inner, nbuf);
......
......@@ -299,3 +299,12 @@ fn test_direct_read_write() {
opts.set_use_direct_writes(true);
DB::open(opts, path.path().to_str().unwrap()).unwrap();
}
#[test]
fn test_writable_file_max_buffer_size() {
let path = TempDir::new("_rust_rocksdb_writable_file_max_buffer_size").expect("");
let mut opts = Options::new();
opts.create_if_missing(true);
opts.set_writable_file_max_buffer_size(1024 * 1024);
DB::open(opts, path.path().to_str().unwrap()).unwrap();
}
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