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,
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);
......
This diff is collapsed.
......@@ -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);
......
......@@ -12,7 +12,7 @@
// limitations under the License.
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::ffi::CString;
use std::mem;
......@@ -62,13 +62,13 @@ extern "C" fn destruct(handle: *mut c_void) {
pub extern "C" fn add(
handle: *mut c_void,
key: *const uint8_t,
key: *const u8,
key_len: size_t,
value: *const uint8_t,
value: *const u8,
value_len: size_t,
entry_type: c_int,
seq: uint64_t,
file_size: uint64_t,
seq: u64,
file_size: u64,
) {
unsafe {
let handle = &mut *(handle as *mut TablePropertiesCollectorHandle);
......
......@@ -12,7 +12,7 @@
// limitations under the License.
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 table_properties_collector::{new_table_properties_collector, TablePropertiesCollector};
......@@ -55,7 +55,7 @@ extern "C" fn destruct(handle: *mut c_void) {
extern "C" fn create_table_properties_collector(
handle: *mut c_void,
cf: uint32_t,
cf: u32,
) -> *mut DBTablePropertiesCollector {
unsafe {
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