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
5abf8854
Unverified
Commit
5abf8854
authored
Apr 21, 2021
by
Xinye Tao
Committed by
GitHub
Apr 21, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some missing option getters (#620)
Signed-off-by:
tabokie
<
xy.tao@outlook.com
>
parent
317625fb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
1 deletion
+91
-1
x86_64-unknown-linux-gnu-bindings.rs
librocksdb_sys/bindings/x86_64-unknown-linux-gnu-bindings.rs
+0
-0
c.cc
librocksdb_sys/crocksdb/c.cc
+32
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+14
-0
lib.rs
librocksdb_sys/src/lib.rs
+7
-0
rocksdb_options.rs
src/rocksdb_options.rs
+38
-0
titan.rs
src/titan.rs
+0
-1
No files found.
librocksdb_sys/bindings/x86_64-unknown-linux-gnu-bindings.rs
View file @
5abf8854
This diff is collapsed.
Click to expand it.
librocksdb_sys/crocksdb/c.cc
View file @
5abf8854
...
...
@@ -2533,6 +2533,10 @@ void crocksdb_options_set_write_buffer_size(crocksdb_options_t* opt, size_t s) {
opt
->
rep
.
write_buffer_size
=
s
;
}
size_t
crocksdb_options_get_write_buffer_size
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
write_buffer_size
;
}
void
crocksdb_options_set_max_open_files
(
crocksdb_options_t
*
opt
,
int
n
)
{
opt
->
rep
.
max_open_files
=
n
;
}
...
...
@@ -2562,6 +2566,11 @@ void crocksdb_options_set_max_bytes_for_level_base(crocksdb_options_t* opt,
opt
->
rep
.
max_bytes_for_level_base
=
n
;
}
uint64_t
crocksdb_options_get_max_bytes_for_level_base
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
max_bytes_for_level_base
;
}
void
crocksdb_options_set_level_compaction_dynamic_level_bytes
(
crocksdb_options_t
*
opt
,
unsigned
char
v
)
{
opt
->
rep
.
level_compaction_dynamic_level_bytes
=
v
;
...
...
@@ -2587,6 +2596,10 @@ void crocksdb_options_set_max_compaction_bytes(crocksdb_options_t* opt,
opt
->
rep
.
max_compaction_bytes
=
n
;
}
uint64_t
crocksdb_options_get_max_compaction_bytes
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
max_compaction_bytes
;
}
void
crocksdb_options_set_max_bytes_for_level_multiplier_additional
(
crocksdb_options_t
*
opt
,
int
*
level_values
,
size_t
num_levels
)
{
opt
->
rep
.
max_bytes_for_level_multiplier_additional
.
resize
(
num_levels
);
...
...
@@ -2637,6 +2650,11 @@ void crocksdb_options_set_level0_file_num_compaction_trigger(
opt
->
rep
.
level0_file_num_compaction_trigger
=
n
;
}
int
crocksdb_options_get_level0_file_num_compaction_trigger
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
level0_file_num_compaction_trigger
;
}
void
crocksdb_options_set_level0_slowdown_writes_trigger
(
crocksdb_options_t
*
opt
,
int
n
)
{
opt
->
rep
.
level0_slowdown_writes_trigger
=
n
;
...
...
@@ -2893,11 +2911,20 @@ void crocksdb_options_set_max_write_buffer_number(crocksdb_options_t* opt,
opt
->
rep
.
max_write_buffer_number
=
n
;
}
int
crocksdb_options_get_max_write_buffer_number
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
max_write_buffer_number
;
}
void
crocksdb_options_set_min_write_buffer_number_to_merge
(
crocksdb_options_t
*
opt
,
int
n
)
{
opt
->
rep
.
min_write_buffer_number_to_merge
=
n
;
}
int
crocksdb_options_get_min_write_buffer_number_to_merge
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
min_write_buffer_number_to_merge
;
}
void
crocksdb_options_set_max_write_buffer_number_to_maintain
(
crocksdb_options_t
*
opt
,
int
n
)
{
opt
->
rep
.
max_write_buffer_number_to_maintain
=
n
;
...
...
@@ -3131,6 +3158,11 @@ void crocksdb_options_set_force_consistency_checks(crocksdb_options_t* opt,
opt
->
rep
.
force_consistency_checks
=
v
;
}
unsigned
char
crocksdb_options_get_force_consistency_checks
(
crocksdb_options_t
*
opt
)
{
return
opt
->
rep
.
force_consistency_checks
;
}
char
*
crocksdb_options_statistics_get_string
(
crocksdb_options_t
*
opt
)
{
if
(
opt
->
rep
.
statistics
)
{
rocksdb
::
Statistics
*
statistics
=
opt
->
rep
.
statistics
.
get
();
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
5abf8854
...
...
@@ -987,6 +987,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_info_log_level(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_write_buffer_size
(
crocksdb_options_t
*
,
size_t
);
extern
C_ROCKSDB_LIBRARY_API
size_t
crocksdb_options_get_write_buffer_size
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_db_write_buffer_size
(
crocksdb_options_t
*
,
size_t
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_open_files
(
...
...
@@ -1015,6 +1017,8 @@ extern C_ROCKSDB_LIBRARY_API int crocksdb_options_get_num_levels(
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_level0_file_num_compaction_trigger
(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
int
crocksdb_options_get_level0_file_num_compaction_trigger
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_level0_slowdown_writes_trigger
(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
int
...
...
@@ -1031,6 +1035,8 @@ extern C_ROCKSDB_LIBRARY_API void
crocksdb_options_set_target_file_size_multiplier
(
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
uint64_t
crocksdb_options_get_max_bytes_for_level_base
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_optimize_filters_for_hits
(
crocksdb_options_t
*
,
unsigned
char
);
...
...
@@ -1083,8 +1089,12 @@ crocksdb_options_statistics_get_histogram(crocksdb_options_t* opt,
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_write_buffer_number
(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
int
crocksdb_options_get_max_write_buffer_number
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_min_write_buffer_number_to_merge
(
crocksdb_options_t
*
,
int
);
extern
C_ROCKSDB_LIBRARY_API
int
crocksdb_options_get_min_write_buffer_number_to_merge
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_write_buffer_number_to_maintain
(
crocksdb_options_t
*
,
int
);
...
...
@@ -1213,6 +1223,8 @@ crocksdb_options_set_memtable_prefix_bloom_size_ratio(crocksdb_options_t*,
double
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_compaction_bytes
(
crocksdb_options_t
*
,
uint64_t
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_options_get_max_compaction_bytes
(
crocksdb_options_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_hash_skip_list_rep
(
crocksdb_options_t
*
,
size_t
,
int32_t
,
int32_t
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_hash_link_list_rep
(
...
...
@@ -1301,6 +1313,8 @@ extern C_ROCKSDB_LIBRARY_API void crocksdb_options_set_delayed_write_rate(
crocksdb_options_t
*
,
uint64_t
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_force_consistency_checks
(
crocksdb_options_t
*
,
unsigned
char
);
extern
C_ROCKSDB_LIBRARY_API
unsigned
char
crocksdb_options_get_force_consistency_checks
(
crocksdb_options_t
*
);
/* RateLimiter */
extern
C_ROCKSDB_LIBRARY_API
crocksdb_ratelimiter_t
*
...
...
librocksdb_sys/src/lib.rs
View file @
5abf8854
...
...
@@ -666,26 +666,32 @@ extern "C" {
pub
fn
crocksdb_options_set_table_cache_numshardbits
(
options
:
*
mut
Options
,
bits
:
c_int
);
pub
fn
crocksdb_options_set_writable_file_max_buffer_size
(
options
:
*
mut
Options
,
nbytes
:
c_int
);
pub
fn
crocksdb_options_set_max_write_buffer_number
(
options
:
*
mut
Options
,
bufno
:
c_int
);
pub
fn
crocksdb_options_get_max_write_buffer_number
(
options
:
*
mut
Options
)
->
c_int
;
pub
fn
crocksdb_options_set_min_write_buffer_number_to_merge
(
options
:
*
mut
Options
,
bufno
:
c_int
,
);
pub
fn
crocksdb_options_get_min_write_buffer_number_to_merge
(
options
:
*
mut
Options
)
->
c_int
;
pub
fn
crocksdb_options_set_level0_file_num_compaction_trigger
(
options
:
*
mut
Options
,
no
:
c_int
,
);
pub
fn
crocksdb_options_get_level0_file_num_compaction_trigger
(
options
:
*
mut
Options
)
->
c_int
;
pub
fn
crocksdb_options_set_level0_slowdown_writes_trigger
(
options
:
*
mut
Options
,
no
:
c_int
);
pub
fn
crocksdb_options_get_level0_slowdown_writes_trigger
(
options
:
*
mut
Options
)
->
c_int
;
pub
fn
crocksdb_options_set_level0_stop_writes_trigger
(
options
:
*
mut
Options
,
no
:
c_int
);
pub
fn
crocksdb_options_get_level0_stop_writes_trigger
(
options
:
*
mut
Options
)
->
c_int
;
pub
fn
crocksdb_options_set_write_buffer_size
(
options
:
*
mut
Options
,
bytes
:
u64
);
pub
fn
crocksdb_options_get_write_buffer_size
(
options
:
*
mut
Options
)
->
u64
;
pub
fn
crocksdb_options_set_target_file_size_base
(
options
:
*
mut
Options
,
bytes
:
u64
);
pub
fn
crocksdb_options_get_target_file_size_base
(
options
:
*
const
Options
)
->
u64
;
pub
fn
crocksdb_options_set_target_file_size_multiplier
(
options
:
*
mut
Options
,
mul
:
c_int
);
pub
fn
crocksdb_options_set_max_bytes_for_level_base
(
options
:
*
mut
Options
,
bytes
:
u64
);
pub
fn
crocksdb_options_get_max_bytes_for_level_base
(
options
:
*
mut
Options
)
->
u64
;
pub
fn
crocksdb_options_set_max_bytes_for_level_multiplier
(
options
:
*
mut
Options
,
mul
:
f64
);
pub
fn
crocksdb_options_get_max_bytes_for_level_multiplier
(
options
:
*
mut
Options
)
->
f64
;
pub
fn
crocksdb_options_set_max_compaction_bytes
(
options
:
*
mut
Options
,
bytes
:
u64
);
pub
fn
crocksdb_options_get_max_compaction_bytes
(
options
:
*
mut
Options
)
->
u64
;
pub
fn
crocksdb_options_set_max_log_file_size
(
options
:
*
mut
Options
,
bytes
:
size_t
);
pub
fn
crocksdb_options_set_log_file_time_to_roll
(
options
:
*
mut
Options
,
bytes
:
size_t
);
pub
fn
crocksdb_options_set_info_log_level
(
options
:
*
mut
Options
,
level
:
DBInfoLogLevel
);
...
...
@@ -815,6 +821,7 @@ extern "C" {
);
pub
fn
crocksdb_options_set_delayed_write_rate
(
options
:
*
mut
Options
,
rate
:
u64
);
pub
fn
crocksdb_options_set_force_consistency_checks
(
options
:
*
mut
Options
,
v
:
bool
);
pub
fn
crocksdb_options_get_force_consistency_checks
(
options
:
*
mut
Options
)
->
bool
;
pub
fn
crocksdb_options_set_ratelimiter
(
options
:
*
mut
Options
,
limiter
:
*
mut
DBRateLimiter
);
pub
fn
crocksdb_options_get_ratelimiter
(
options
:
*
mut
Options
)
->
*
mut
DBRateLimiter
;
pub
fn
crocksdb_options_set_info_log
(
options
:
*
mut
Options
,
logger
:
*
mut
DBLogger
);
...
...
src/rocksdb_options.rs
View file @
5abf8854
...
...
@@ -1556,24 +1556,42 @@ impl ColumnFamilyOptions {
}
}
pub
fn
get_min_write_buffer_number
(
&
mut
self
)
->
u32
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_min_write_buffer_number_to_merge
(
self
.inner
)
as
u32
}
}
pub
fn
set_max_write_buffer_number
(
&
mut
self
,
nbuf
:
c_int
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_max_write_buffer_number
(
self
.inner
,
nbuf
);
}
}
pub
fn
get_max_write_buffer_number
(
&
mut
self
)
->
u32
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_max_write_buffer_number
(
self
.inner
)
as
u32
}
}
pub
fn
set_write_buffer_size
(
&
mut
self
,
size
:
u64
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_write_buffer_size
(
self
.inner
,
size
);
}
}
pub
fn
get_write_buffer_size
(
&
mut
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_write_buffer_size
(
self
.inner
)
as
u64
}
}
pub
fn
set_max_bytes_for_level_base
(
&
mut
self
,
size
:
u64
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_max_bytes_for_level_base
(
self
.inner
,
size
);
}
}
pub
fn
get_max_bytes_for_level_base
(
&
mut
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_max_bytes_for_level_base
(
self
.inner
)
as
u64
}
}
pub
fn
set_max_bytes_for_level_multiplier
(
&
mut
self
,
mul
:
i32
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_max_bytes_for_level_multiplier
(
...
...
@@ -1595,6 +1613,10 @@ impl ColumnFamilyOptions {
}
}
pub
fn
get_max_compaction_bytes
(
&
mut
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_max_compaction_bytes
(
self
.inner
)
}
}
pub
fn
set_level_compaction_dynamic_level_bytes
(
&
mut
self
,
v
:
bool
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_level_compaction_dynamic_level_bytes
(
self
.inner
,
v
);
...
...
@@ -1653,12 +1675,24 @@ impl ColumnFamilyOptions {
}
}
pub
fn
get_min_write_buffer_number_to_merge
(
&
mut
self
)
->
u32
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_min_write_buffer_number_to_merge
(
self
.inner
)
as
u32
}
}
pub
fn
set_level_zero_file_num_compaction_trigger
(
&
mut
self
,
n
:
c_int
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_level0_file_num_compaction_trigger
(
self
.inner
,
n
);
}
}
pub
fn
get_level_zero_file_num_compaction_trigger
(
&
mut
self
)
->
u32
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_level0_file_num_compaction_trigger
(
self
.inner
)
as
u32
}
}
pub
fn
set_level_zero_slowdown_writes_trigger
(
&
mut
self
,
n
:
c_int
)
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_set_level0_slowdown_writes_trigger
(
self
.inner
,
n
);
...
...
@@ -1791,6 +1825,10 @@ impl ColumnFamilyOptions {
}
}
pub
fn
get_force_consistency_checks
(
&
mut
self
)
->
bool
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_force_consistency_checks
(
self
.inner
)
}
}
pub
fn
get_block_cache_usage
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_options_get_block_cache_usage
(
self
.inner
)
as
u64
}
}
...
...
src/titan.rs
View file @
5abf8854
...
...
@@ -80,7 +80,6 @@ impl TitanDBOptions {
}
}
pub
fn
set_disable_background_gc
(
&
mut
self
,
disable
:
bool
)
{
unsafe
{
crocksdb_ffi
::
ctitandb_options_set_disable_background_gc
(
self
.inner
,
disable
);
...
...
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