Unverified Commit 23a60445 authored by Wallace's avatar Wallace Committed by GitHub

add unordered write (#380)

Signed-off-by: 's avatarLittle-Wallace <bupt2013211450@gmail.com>
parent 83165e83
......@@ -2589,6 +2589,11 @@ void crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *opt,
opt->rep.enable_pipelined_write = v;
}
void crocksdb_options_set_unordered_write(crocksdb_options_t* opt,
unsigned char v) {
opt->rep.unordered_write = v;
}
void crocksdb_options_set_allow_concurrent_memtable_write(crocksdb_options_t* opt,
unsigned char v) {
opt->rep.allow_concurrent_memtable_write = v;
......
......@@ -1042,8 +1042,9 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_use_adaptive_mutex(
extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_bytes_per_sync(
crocksdb_options_t*, uint64_t);
extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *,
unsigned char);
crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *, unsigned char);
extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_unordered_write(crocksdb_options_t*, unsigned char);
extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_allow_concurrent_memtable_write(crocksdb_options_t *,
unsigned char);
......
......@@ -485,6 +485,7 @@ extern "C" {
pub fn crocksdb_options_set_use_fsync(options: *mut Options, v: c_int);
pub fn crocksdb_options_set_bytes_per_sync(options: *mut Options, bytes: u64);
pub fn crocksdb_options_set_enable_pipelined_write(options: *mut Options, v: bool);
pub fn crocksdb_options_set_unordered_write(options: *mut Options, v: bool);
pub fn crocksdb_options_set_allow_concurrent_memtable_write(options: *mut Options, v: bool);
pub fn crocksdb_options_set_manual_wal_flush(options: *mut Options, v: bool);
pub fn crocksdb_options_optimize_for_point_lookup(
......
......@@ -1022,6 +1022,12 @@ impl DBOptions {
}
}
pub fn enable_unordered_write(&self, v: bool) {
unsafe {
crocksdb_ffi::crocksdb_options_set_unordered_write(self.inner, v);
}
}
pub fn allow_concurrent_memtable_write(&self, v: bool) {
unsafe {
crocksdb_ffi::crocksdb_options_set_allow_concurrent_memtable_write(self.inner, v);
......
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