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
21b728aa
Commit
21b728aa
authored
Apr 27, 2017
by
zhangjinpeng1987
Committed by
GitHub
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support optimize_filters_for_hits (#42)
parent
b3550b42
Show 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 @
21b728aa
...
...
@@ -1758,6 +1758,11 @@ void crocksdb_options_set_prefix_extractor(
opt
->
rep
.
prefix_extractor
.
reset
(
prefix_extractor
);
}
void
crocksdb_options_set_optimize_filters_for_hits
(
crocksdb_options_t
*
opt
,
unsigned
char
v
)
{
opt
->
rep
.
optimize_filters_for_hits
=
v
;
}
void
crocksdb_options_set_memtable_insert_with_hint_prefix_extractor
(
crocksdb_options_t
*
opt
,
crocksdb_slicetransform_t
*
prefix_extractor
)
{
opt
->
rep
.
memtable_insert_with_hint_prefix_extractor
.
reset
(
prefix_extractor
);
...
...
librocksdb_sys/crocksdb/rocksdb/c.h
View file @
21b728aa
...
...
@@ -628,6 +628,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_target_file_size_multipli
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_bytes_for_level_base
(
crocksdb_options_t
*
,
uint64_t
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_optimize_filters_for_hits
(
crocksdb_options_t
*
,
unsigned
char
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_level_compaction_dynamic_level_bytes
(
crocksdb_options_t
*
,
unsigned
char
);
...
...
librocksdb_sys/src/lib.rs
View file @
21b728aa
...
...
@@ -284,6 +284,7 @@ extern "C" {
pub
fn
crocksdb_options_set_wal_size_limit_mb
(
options
:
*
mut
DBOptions
,
limit
:
u64
);
pub
fn
crocksdb_options_set_prefix_extractor
(
options
:
*
mut
DBOptions
,
prefix_extractor
:
*
mut
DBSliceTransform
);
pub
fn
crocksdb_options_set_optimize_filters_for_hits
(
options
:
*
mut
DBOptions
,
v
:
bool
);
pub
fn
crocksdb_options_set_memtable_insert_with_hint_prefix_extractor
(
options
:
*
mut
DBOptions
,
prefix_extractor
:
*
mut
DBSliceTransform
);
pub
fn
crocksdb_options_set_memtable_prefix_bloom_size_ratio
(
options
:
*
mut
DBOptions
,
...
...
src/rocksdb_options.rs
View file @
21b728aa
...
...
@@ -732,6 +732,12 @@ impl Options {
}
}
pub
fn
set_optimize_filters_for_hits
(
&
mut
self
,
v
:
bool
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_optimize_filters_for_hits
(
self
.inner
,
v
);
}
}
pub
fn
set_memtable_insert_hint_prefix_extractor
<
S
>
(
&
mut
self
,
name
:
S
,
transform
:
Box
<
SliceTransform
>
)
...
...
tests/test_rocksdb_options.rs
View file @
21b728aa
...
...
@@ -212,6 +212,15 @@ fn test_set_max_subcompactions() {
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
}
#[test]
fn
test_set_optimize_filters_for_hits
()
{
let
path
=
TempDir
::
new
(
"_rust_rocksdb_optimize_filters_for_hits"
)
.expect
(
""
);
let
mut
opts
=
Options
::
new
();
opts
.create_if_missing
(
true
);
opts
.set_optimize_filters_for_hits
(
true
);
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
}
#[test]
fn
test_get_block_cache_usage
()
{
let
path
=
TempDir
::
new
(
"_rust_rocksdb_set_cache_and_index"
)
.expect
(
""
);
...
...
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