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
714f3272
Commit
714f3272
authored
Mar 27, 2017
by
siddontang
Committed by
GitHub
Mar 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support pin l0 filter and index in cache (#32)
parent
511dd22f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
lib.rs
librocksdb_sys/src/lib.rs
+2
-0
rocksdb_options.rs
src/rocksdb_options.rs
+8
-0
test_rocksdb_options.rs
tests/test_rocksdb_options.rs
+14
-1
No files found.
librocksdb_sys/src/lib.rs
View file @
714f3272
...
...
@@ -193,6 +193,8 @@ extern "C" {
pub
fn
crocksdb_options_set_block_based_table_factory
(
options
:
*
mut
DBOptions
,
block_options
:
*
mut
DBBlockBasedTableOptions
);
pub
fn
crocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache
(
block_options
:
*
mut
DBBlockBasedTableOptions
,
v
:
c_uchar
);
pub
fn
crocksdb_options_increase_parallelism
(
options
:
*
mut
DBOptions
,
threads
:
c_int
);
pub
fn
crocksdb_options_optimize_level_style_compaction
(
options
:
*
mut
DBOptions
,
memtable_memory_budget
:
c_int
);
...
...
src/rocksdb_options.rs
View file @
714f3272
...
...
@@ -103,6 +103,14 @@ impl BlockBasedOptions {
crocksdb_ffi
::
crocksdb_block_based_options_set_whole_key_filtering
(
self
.inner
,
v
);
}
}
pub
fn
set_pin_l0_filter_and_index_blocks_in_cache
(
&
mut
self
,
v
:
bool
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_block_based_options_set_pin_l0_filter_and_index_blocks_in_cache
(
self
.inner
,
v
as
u8
);
}
}
}
pub
struct
RateLimiter
{
...
...
tests/test_rocksdb_options.rs
View file @
714f3272
...
...
@@ -11,7 +11,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use
rocksdb
::{
DB
,
Options
,
WriteOptions
,
SliceTransform
};
use
rocksdb
::{
DB
,
Options
,
BlockBasedOptions
,
WriteOptions
,
SliceTransform
};
use
rocksdb
::
crocksdb_ffi
::{
DBStatisticsHistogramType
as
HistogramType
,
DBStatisticsTickerType
as
TickerType
};
use
std
::
path
::
Path
;
...
...
@@ -147,3 +147,15 @@ fn test_create_info_log() {
drop
(
db
);
}
#[test]
fn
test_set_pin_l0_filter_and_index_blocks_in_cache
()
{
let
path
=
TempDir
::
new
(
"_rust_rocksdb_set_cache_and_index"
)
.expect
(
""
);
let
mut
opts
=
Options
::
new
();
opts
.create_if_missing
(
true
);
let
mut
block_opts
=
BlockBasedOptions
::
new
();
block_opts
.set_pin_l0_filter_and_index_blocks_in_cache
(
true
);
opts
.set_block_based_table_factory
(
&
block_opts
);
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
drop
(
db
);
}
\ No newline at end of file
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