Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
e965e428
Commit
e965e428
authored
Oct 24, 2019
by
Little-Wallace
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add unordered write
Signed-off-by:
Little-Wallace
<
bupt2013211450@gmail.com
>
parent
c130c13b
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
21 additions
and
9 deletions
+21
-9
c.cc
librocksdb_sys/crocksdb/c.cc
+5
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+3
-2
lib.rs
librocksdb_sys/src/lib.rs
+0
-0
rocksdb_options.rs
src/rocksdb_options.rs
+6
-0
table_properties_collector.rs
src/table_properties_collector.rs
+5
-5
table_properties_collector_factory.rs
src/table_properties_collector_factory.rs
+2
-2
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
e965e428
...
...
@@ -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
;
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
e965e428
...
...
@@ -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
);
...
...
librocksdb_sys/src/lib.rs
View file @
e965e428
This diff is collapsed.
Click to expand it.
src/rocksdb_options.rs
View file @
e965e428
...
...
@@ -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
);
...
...
src/table_properties_collector.rs
View file @
e965e428
...
...
@@ -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
u
int8_t
,
key
:
*
const
u
8
,
key_len
:
size_t
,
value
:
*
const
u
int8_t
,
value
:
*
const
u
8
,
value_len
:
size_t
,
entry_type
:
c_int
,
seq
:
u
int64_t
,
file_size
:
u
int64_t
,
seq
:
u
64
,
file_size
:
u
64
,
)
{
unsafe
{
let
handle
=
&
mut
*
(
handle
as
*
mut
TablePropertiesCollectorHandle
);
...
...
src/table_properties_collector_factory.rs
View file @
e965e428
...
...
@@ -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
:
u
int32_t
,
cf
:
u
32
,
)
->
*
mut
DBTablePropertiesCollector
{
unsafe
{
let
handle
=
&
mut
*
(
handle
as
*
mut
TablePropertiesCollectorFactoryHandle
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment