Commit e965e428 authored by Little-Wallace's avatar Little-Wallace

add unordered write

Signed-off-by: 's avatarLittle-Wallace <bupt2013211450@gmail.com>
parent c130c13b
...@@ -2589,6 +2589,11 @@ void crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *opt, ...@@ -2589,6 +2589,11 @@ void crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *opt,
opt->rep.enable_pipelined_write = v; 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, void crocksdb_options_set_allow_concurrent_memtable_write(crocksdb_options_t* opt,
unsigned char v) { unsigned char v) {
opt->rep.allow_concurrent_memtable_write = v; opt->rep.allow_concurrent_memtable_write = v;
......
...@@ -1042,8 +1042,9 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_use_adaptive_mutex( ...@@ -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( extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_bytes_per_sync(
crocksdb_options_t*, uint64_t); crocksdb_options_t*, uint64_t);
extern C_ROCKSDB_LIBRARY_API void extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *, crocksdb_options_set_enable_pipelined_write(crocksdb_options_t *, unsigned char);
unsigned char); extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_unordered_write(crocksdb_options_t*, unsigned char);
extern C_ROCKSDB_LIBRARY_API void extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_allow_concurrent_memtable_write(crocksdb_options_t *, crocksdb_options_set_allow_concurrent_memtable_write(crocksdb_options_t *,
unsigned char); unsigned char);
......
This diff is collapsed.
...@@ -1022,6 +1022,12 @@ impl DBOptions { ...@@ -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) { pub fn allow_concurrent_memtable_write(&self, v: bool) {
unsafe { unsafe {
crocksdb_ffi::crocksdb_options_set_allow_concurrent_memtable_write(self.inner, v); crocksdb_ffi::crocksdb_options_set_allow_concurrent_memtable_write(self.inner, v);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// limitations under the License. // limitations under the License.
use crocksdb_ffi::{self, DBEntryType, DBTablePropertiesCollector, DBUserCollectedProperties}; use crocksdb_ffi::{self, DBEntryType, DBTablePropertiesCollector, DBUserCollectedProperties};
use libc::{c_char, c_int, c_void, size_t, uint64_t, uint8_t}; use libc::{c_char, c_int, c_void, size_t};
use std::collections::HashMap; use std::collections::HashMap;
use std::ffi::CString; use std::ffi::CString;
use std::mem; use std::mem;
...@@ -62,13 +62,13 @@ extern "C" fn destruct(handle: *mut c_void) { ...@@ -62,13 +62,13 @@ extern "C" fn destruct(handle: *mut c_void) {
pub extern "C" fn add( pub extern "C" fn add(
handle: *mut c_void, handle: *mut c_void,
key: *const uint8_t, key: *const u8,
key_len: size_t, key_len: size_t,
value: *const uint8_t, value: *const u8,
value_len: size_t, value_len: size_t,
entry_type: c_int, entry_type: c_int,
seq: uint64_t, seq: u64,
file_size: uint64_t, file_size: u64,
) { ) {
unsafe { unsafe {
let handle = &mut *(handle as *mut TablePropertiesCollectorHandle); let handle = &mut *(handle as *mut TablePropertiesCollectorHandle);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
// limitations under the License. // limitations under the License.
use crocksdb_ffi::{self, DBTablePropertiesCollector, DBTablePropertiesCollectorFactory}; use crocksdb_ffi::{self, DBTablePropertiesCollector, DBTablePropertiesCollectorFactory};
use libc::{c_char, c_void, uint32_t}; use libc::{c_char, c_void};
use std::ffi::CString; use std::ffi::CString;
use table_properties_collector::{new_table_properties_collector, TablePropertiesCollector}; use table_properties_collector::{new_table_properties_collector, TablePropertiesCollector};
...@@ -55,7 +55,7 @@ extern "C" fn destruct(handle: *mut c_void) { ...@@ -55,7 +55,7 @@ extern "C" fn destruct(handle: *mut c_void) {
extern "C" fn create_table_properties_collector( extern "C" fn create_table_properties_collector(
handle: *mut c_void, handle: *mut c_void,
cf: uint32_t, cf: u32,
) -> *mut DBTablePropertiesCollector { ) -> *mut DBTablePropertiesCollector {
unsafe { unsafe {
let handle = &mut *(handle as *mut TablePropertiesCollectorFactoryHandle); let handle = &mut *(handle as *mut TablePropertiesCollectorFactoryHandle);
......
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