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
150bf4f5
Commit
150bf4f5
authored
May 11, 2016
by
ngaut
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: add an option to disable write-ahead-log.
parent
015e65bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
2 deletions
+13
-2
merge_operator.rs
src/merge_operator.rs
+0
-2
rocksdb.rs
src/rocksdb.rs
+6
-0
rocksdb_options.rs
src/rocksdb_options.rs
+7
-0
No files found.
src/merge_operator.rs
View file @
150bf4f5
...
...
@@ -41,7 +41,6 @@ pub extern "C" fn name_callback(raw_cb: *mut c_void) -> *const c_char {
}
}
#[allow(too_many_arguments)]
pub
extern
"C"
fn
full_merge_callback
(
raw_cb
:
*
mut
c_void
,
raw_key
:
*
const
c_char
,
key_len
:
size_t
,
...
...
@@ -75,7 +74,6 @@ pub extern "C" fn full_merge_callback(raw_cb: *mut c_void,
}
}
#[allow(too_many_arguments)]
pub
extern
"C"
fn
partial_merge_callback
(
raw_cb
:
*
mut
c_void
,
raw_key
:
*
const
c_char
,
key_len
:
size_t
,
...
...
src/rocksdb.rs
View file @
150bf4f5
...
...
@@ -440,6 +440,12 @@ impl DB {
self
.write_opt
(
batch
,
&
WriteOptions
::
new
())
}
pub
fn
write_withou_wal
(
&
self
,
batch
:
WriteBatch
)
->
Result
<
(),
String
>
{
let
mut
wo
=
WriteOptions
::
new
();
wo
.disable_wal
();
self
.write_opt
(
batch
,
&
wo
)
}
pub
fn
get_opt
(
&
self
,
key
:
&
[
u8
],
readopts
:
&
ReadOptions
)
...
...
src/rocksdb_options.rs
View file @
150bf4f5
...
...
@@ -377,9 +377,16 @@ impl WriteOptions {
pub
fn
new
()
->
WriteOptions
{
WriteOptions
::
default
()
}
pub
fn
set_sync
(
&
mut
self
,
sync
:
bool
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_writeoptions_set_sync
(
self
.inner
,
sync
);
}
}
pub
fn
disable_wal
(
&
mut
self
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_writeoptions_disable_WAL
(
self
.inner
,
1
);
}
}
}
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