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
8580183e
Commit
8580183e
authored
May 04, 2017
by
Li Shihai
Committed by
siddontang
May 04, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
export writable_file_max_buffer_size option (#56)
parent
79c27a41
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
0 deletions
+23
-0
c.cc
librocksdb_sys/crocksdb/c.cc
+5
-0
c.h
librocksdb_sys/crocksdb/rocksdb/c.h
+2
-0
lib.rs
librocksdb_sys/src/lib.rs
+1
-0
rocksdb_options.rs
src/rocksdb_options.rs
+6
-0
test_rocksdb_options.rs
tests/test_rocksdb_options.rs
+9
-0
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
8580183e
...
@@ -1966,6 +1966,11 @@ void crocksdb_options_set_table_cache_numshardbits(
...
@@ -1966,6 +1966,11 @@ void crocksdb_options_set_table_cache_numshardbits(
opt
->
rep
.
table_cache_numshardbits
=
v
;
opt
->
rep
.
table_cache_numshardbits
=
v
;
}
}
void
crocksdb_options_set_writable_file_max_buffer_size
(
crocksdb_options_t
*
opt
,
int
v
)
{
opt
->
rep
.
writable_file_max_buffer_size
=
v
;
}
void
crocksdb_options_set_table_cache_remove_scan_count_limit
(
void
crocksdb_options_set_table_cache_remove_scan_count_limit
(
crocksdb_options_t
*
opt
,
int
v
)
{
crocksdb_options_t
*
opt
,
int
v
)
{
// this option is deprecated
// this option is deprecated
...
...
librocksdb_sys/crocksdb/rocksdb/c.h
View file @
8580183e
...
@@ -703,6 +703,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_max_manifest_file_size(
...
@@ -703,6 +703,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_max_manifest_file_size(
crocksdb_options_t
*
,
size_t
);
crocksdb_options_t
*
,
size_t
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_table_cache_numshardbits
(
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_table_cache_numshardbits
(
crocksdb_options_t
*
,
int
);
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_writable_file_max_buffer_size
(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
void
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_table_cache_remove_scan_count_limit
(
crocksdb_options_t
*
,
crocksdb_options_set_table_cache_remove_scan_count_limit
(
crocksdb_options_t
*
,
int
);
int
);
...
...
librocksdb_sys/src/lib.rs
View file @
8580183e
...
@@ -220,6 +220,7 @@ extern "C" {
...
@@ -220,6 +220,7 @@ extern "C" {
pub
fn
crocksdb_options_optimize_for_point_lookup
(
options
:
*
mut
DBOptions
,
pub
fn
crocksdb_options_optimize_for_point_lookup
(
options
:
*
mut
DBOptions
,
block_cache_size_mb
:
u64
);
block_cache_size_mb
:
u64
);
pub
fn
crocksdb_options_set_table_cache_numshardbits
(
options
:
*
mut
DBOptions
,
bits
:
c_int
);
pub
fn
crocksdb_options_set_table_cache_numshardbits
(
options
:
*
mut
DBOptions
,
bits
:
c_int
);
pub
fn
crocksdb_options_set_writable_file_max_buffer_size
(
options
:
*
mut
DBOptions
,
nbytes
:
c_int
);
pub
fn
crocksdb_options_set_max_write_buffer_number
(
options
:
*
mut
DBOptions
,
bufno
:
c_int
);
pub
fn
crocksdb_options_set_max_write_buffer_number
(
options
:
*
mut
DBOptions
,
bufno
:
c_int
);
pub
fn
crocksdb_options_set_min_write_buffer_number_to_merge
(
options
:
*
mut
DBOptions
,
pub
fn
crocksdb_options_set_min_write_buffer_number_to_merge
(
options
:
*
mut
DBOptions
,
bufno
:
c_int
);
bufno
:
c_int
);
...
...
src/rocksdb_options.rs
View file @
8580183e
...
@@ -467,6 +467,12 @@ impl Options {
...
@@ -467,6 +467,12 @@ impl Options {
}
}
}
}
pub
fn
set_writable_file_max_buffer_size
(
&
mut
self
,
nbytes
:
c_int
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_writable_file_max_buffer_size
(
self
.inner
,
nbytes
);
}
}
pub
fn
set_min_write_buffer_number
(
&
mut
self
,
nbuf
:
c_int
)
{
pub
fn
set_min_write_buffer_number
(
&
mut
self
,
nbuf
:
c_int
)
{
unsafe
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_min_write_buffer_number_to_merge
(
self
.inner
,
nbuf
);
crocksdb_ffi
::
crocksdb_options_set_min_write_buffer_number_to_merge
(
self
.inner
,
nbuf
);
...
...
tests/test_rocksdb_options.rs
View file @
8580183e
...
@@ -299,3 +299,12 @@ fn test_direct_read_write() {
...
@@ -299,3 +299,12 @@ fn test_direct_read_write() {
opts
.set_use_direct_writes
(
true
);
opts
.set_use_direct_writes
(
true
);
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
}
}
#[test]
fn
test_writable_file_max_buffer_size
()
{
let
path
=
TempDir
::
new
(
"_rust_rocksdb_writable_file_max_buffer_size"
)
.expect
(
""
);
let
mut
opts
=
Options
::
new
();
opts
.create_if_missing
(
true
);
opts
.set_writable_file_max_buffer_size
(
1024
*
1024
);
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
}
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