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
4c1b1655
Commit
4c1b1655
authored
Sep 30, 2016
by
zhangjinpeng1987
Committed by
Jay
Sep 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set num levels (#45)
parent
41468f31
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
0 deletions
+21
-0
lib.rs
librocksdb_sys/src/lib.rs
+1
-0
rocksdb_options.rs
src/rocksdb_options.rs
+6
-0
test.rs
test/test.rs
+1
-0
test_rocksdb_options.rs
test/test_rocksdb_options.rs
+13
-0
No files found.
librocksdb_sys/src/lib.rs
View file @
4c1b1655
...
@@ -199,6 +199,7 @@ extern "C" {
...
@@ -199,6 +199,7 @@ extern "C" {
pub
fn
rocksdb_options_set_wal_recovery_mode
(
options
:
*
mut
DBOptions
,
mode
:
DBRecoveryMode
);
pub
fn
rocksdb_options_set_wal_recovery_mode
(
options
:
*
mut
DBOptions
,
mode
:
DBRecoveryMode
);
pub
fn
rocksdb_options_enable_statistics
(
options
:
*
mut
DBOptions
);
pub
fn
rocksdb_options_enable_statistics
(
options
:
*
mut
DBOptions
);
pub
fn
rocksdb_options_set_stats_dump_period_sec
(
options
:
*
mut
DBOptions
,
v
:
usize
);
pub
fn
rocksdb_options_set_stats_dump_period_sec
(
options
:
*
mut
DBOptions
,
v
:
usize
);
pub
fn
rocksdb_options_set_num_levels
(
options
:
*
mut
DBOptions
,
v
:
c_int
);
pub
fn
rocksdb_filterpolicy_create_bloom_full
(
bits_per_key
:
c_int
)
pub
fn
rocksdb_filterpolicy_create_bloom_full
(
bits_per_key
:
c_int
)
->
*
mut
DBFilterPolicy
;
->
*
mut
DBFilterPolicy
;
pub
fn
rocksdb_filterpolicy_create_bloom
(
bits_per_key
:
c_int
)
pub
fn
rocksdb_filterpolicy_create_bloom
(
bits_per_key
:
c_int
)
...
...
src/rocksdb_options.rs
View file @
4c1b1655
...
@@ -563,6 +563,12 @@ impl Options {
...
@@ -563,6 +563,12 @@ impl Options {
period
);
period
);
}
}
}
}
pub
fn
set_num_levels
(
&
mut
self
,
n
:
c_int
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_options_set_num_levels
(
self
.inner
,
n
);
}
}
}
}
pub
struct
FlushOptions
{
pub
struct
FlushOptions
{
...
...
test/test.rs
View file @
4c1b1655
...
@@ -6,3 +6,4 @@ mod test_multithreaded;
...
@@ -6,3 +6,4 @@ mod test_multithreaded;
mod
test_column_family
;
mod
test_column_family
;
mod
test_compaction_filter
;
mod
test_compaction_filter
;
mod
test_compact_range
;
mod
test_compact_range
;
mod
test_rocksdb_options
;
test/test_rocksdb_options.rs
0 → 100644
View file @
4c1b1655
use
tempdir
::
TempDir
;
use
rocksdb
::{
DB
,
Options
};
#[test]
fn
test_set_num_levels
()
{
let
path
=
TempDir
::
new
(
"_rust_rocksdb_test_set_num_levels"
)
.expect
(
""
);
let
mut
opts
=
Options
::
new
();
opts
.create_if_missing
(
true
);
opts
.set_num_levels
(
2
);
let
db
=
DB
::
open
(
&
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
drop
(
db
);
}
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