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
8099465d
Unverified
Commit
8099465d
authored
Mar 05, 2021
by
Zhenhan Gong
Committed by
GitHub
Mar 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expose titan zstd-max-train-bytes (#591)
parent
884dcc49
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
46 additions
and
1 deletion
+46
-1
c.cc
librocksdb_sys/crocksdb/c.cc
+12
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+3
-0
lib.rs
librocksdb_sys/src/lib.rs
+8
-0
titan.rs
src/titan.rs
+21
-0
test_titan.rs
tests/cases/test_titan.rs
+2
-1
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
8099465d
...
...
@@ -6257,6 +6257,18 @@ void ctitandb_options_set_blob_file_compression(ctitandb_options_t* opts,
opts
->
rep
.
blob_file_compression
=
static_cast
<
CompressionType
>
(
type
);
}
void
ctitandb_options_set_compression_options
(
ctitandb_options_t
*
opt
,
int
w_bits
,
int
level
,
int
strategy
,
int
max_dict_bytes
,
int
zstd_max_train_bytes
)
{
opt
->
rep
.
blob_file_compression_options
.
window_bits
=
w_bits
;
opt
->
rep
.
blob_file_compression_options
.
level
=
level
;
opt
->
rep
.
blob_file_compression_options
.
strategy
=
strategy
;
opt
->
rep
.
blob_file_compression_options
.
max_dict_bytes
=
max_dict_bytes
;
opt
->
rep
.
blob_file_compression_options
.
zstd_max_train_bytes
=
zstd_max_train_bytes
;
}
void
ctitandb_options_set_gc_merge_rewrite
(
ctitandb_options_t
*
opts
,
unsigned
char
enable
)
{
opts
->
rep
.
gc_merge_rewrite
=
enable
;
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
8099465d
...
...
@@ -2476,6 +2476,9 @@ extern C_ROCKSDB_LIBRARY_API void ctitandb_options_set_gc_merge_rewrite(
extern
C_ROCKSDB_LIBRARY_API
void
ctitandb_options_set_blob_file_compression
(
ctitandb_options_t
*
,
int
type
);
extern
C_ROCKSDB_LIBRARY_API
void
ctitandb_options_set_compression_options
(
ctitandb_options_t
*
opt
,
int
,
int
,
int
,
int
,
int
);
extern
C_ROCKSDB_LIBRARY_API
void
ctitandb_decode_blob_index
(
const
char
*
value
,
size_t
value_size
,
ctitandb_blob_index_t
*
index
,
char
**
errptr
);
...
...
librocksdb_sys/src/lib.rs
View file @
8099465d
...
...
@@ -2552,6 +2552,14 @@ extern "C" {
opts
:
*
mut
DBTitanDBOptions
,
t
:
DBCompressionType
,
);
pub
fn
ctitandb_options_set_compression_options
(
options
:
*
mut
DBTitanDBOptions
,
window_bits
:
c_int
,
level
:
c_int
,
strategy
:
c_int
,
max_dict_bytes
:
c_int
,
zstd_max_train_bytes
:
c_int
,
);
pub
fn
ctitandb_decode_blob_index
(
value
:
*
const
u8
,
...
...
src/titan.rs
View file @
8099465d
...
...
@@ -60,6 +60,27 @@ impl TitanDBOptions {
}
}
pub
fn
set_compression_options
(
&
mut
self
,
window_bits
:
i32
,
level
:
i32
,
strategy
:
i32
,
max_dict_bytes
:
i32
,
zstd_max_train_bytes
:
i32
,
)
{
unsafe
{
crocksdb_ffi
::
ctitandb_options_set_compression_options
(
self
.inner
,
window_bits
,
level
,
strategy
,
max_dict_bytes
,
zstd_max_train_bytes
,
)
}
}
pub
fn
set_disable_background_gc
(
&
mut
self
,
disable
:
bool
)
{
unsafe
{
crocksdb_ffi
::
ctitandb_options_set_disable_background_gc
(
self
.inner
,
disable
);
...
...
tests/cases/test_titan.rs
View file @
8099465d
...
...
@@ -108,7 +108,8 @@ fn test_titandb() {
let
mut
tdb_opts
=
TitanDBOptions
::
new
();
tdb_opts
.set_dirname
(
tdb_path
.to_str
()
.unwrap
());
tdb_opts
.set_min_blob_size
(
max_value_size
/
2
+
1
);
tdb_opts
.set_blob_file_compression
(
DBCompressionType
::
No
);
tdb_opts
.set_blob_file_compression
(
DBCompressionType
::
Zstd
);
tdb_opts
.set_compression_options
(
-
14
,
0
,
0
,
0
,
0
);
tdb_opts
.set_disable_background_gc
(
true
);
tdb_opts
.set_purge_obsolete_files_period
(
10
);
tdb_opts
.set_level_merge
(
false
);
...
...
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