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
74947e8e
Commit
74947e8e
authored
Jun 05, 2019
by
Xinye Tao
Committed by
Yi Wu
Jun 20, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Titan (#299)
* add titan blob-run-mode * checkout latest bug fix and titan stats
parent
7226c90a
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
3 deletions
+24
-3
c.cc
librocksdb_sys/crocksdb/c.cc
+6
-0
titan
librocksdb_sys/libtitan_sys/titan
+1
-1
lib.rs
librocksdb_sys/src/lib.rs
+9
-0
lib.rs
src/lib.rs
+1
-1
titan.rs
src/titan.rs
+7
-1
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
74947e8e
...
...
@@ -170,6 +170,7 @@ using rocksdb::titandb::TitanCFOptions;
using
rocksdb
::
titandb
::
TitanDB
;
using
rocksdb
::
titandb
::
TitanDBOptions
;
using
rocksdb
::
titandb
::
TitanOptions
;
using
rocksdb
::
titandb
::
TitanBlobRunMode
;
using
std
::
shared_ptr
;
...
...
@@ -5103,4 +5104,9 @@ void ctitandb_options_set_sample_ratio(ctitandb_options_t* options,
options
->
rep
.
sample_file_size_ratio
=
ratio
;
}
void
ctitandb_options_set_blob_run_mode
(
ctitandb_options_t
*
options
,
int
mode
)
{
options
->
rep
.
blob_run_mode
=
static_cast
<
TitanBlobRunMode
>
(
mode
);
}
}
// end extern "C"
titan
@
ec440e2a
Subproject commit
c673677c138e2f652b5da332598300762588e4ab
Subproject commit
ec440e2a17dd41910f92453be3aaa7e9acc644b8
librocksdb_sys/src/lib.rs
View file @
74947e8e
...
...
@@ -272,6 +272,14 @@ pub enum DBRateLimiterMode {
AllIo
=
3
,
}
#[derive(Copy,
Clone,
Debug,
Eq,
PartialEq)]
#[repr(C)]
pub
enum
DBTitanDBBlobRunMode
{
Normal
=
0
,
ReadOnly
=
1
,
Fallback
=
2
,
}
pub
fn
error_message
(
ptr
:
*
mut
c_char
)
->
String
{
let
c_str
=
unsafe
{
CStr
::
from_ptr
(
ptr
)
};
let
s
=
format!
(
"{}"
,
c_str
.to_string_lossy
());
...
...
@@ -1849,6 +1857,7 @@ extern "C" {
pub
fn
ctitandb_options_set_discardable_ratio
(
opts
:
*
mut
DBTitanDBOptions
,
ratio
:
f64
);
pub
fn
ctitandb_options_set_sample_ratio
(
opts
:
*
mut
DBTitanDBOptions
,
ratio
:
f64
);
pub
fn
ctitandb_options_set_merge_small_file_threshold
(
opts
:
*
mut
DBTitanDBOptions
,
size
:
u64
);
pub
fn
ctitandb_options_set_blob_run_mode
(
opts
:
*
mut
DBTitanDBOptions
,
t
:
DBTitanDBBlobRunMode
);
}
#[cfg(test)]
...
...
src/lib.rs
View file @
74947e8e
...
...
@@ -28,7 +28,7 @@ pub use librocksdb_sys::{
self
as
crocksdb_ffi
,
new_bloom_filter
,
CompactionPriority
,
CompactionReason
,
DBBottommostLevelCompaction
,
DBCompactionStyle
,
DBCompressionType
,
DBEntryType
,
DBInfoLogLevel
,
DBRateLimiterMode
,
DBRecoveryMode
,
DBStatisticsHistogramType
,
DBStatisticsTickerType
,
WriteStallCondition
,
DBTitanDBBlobRunMode
,
WriteStallCondition
,
};
pub
use
merge_operator
::
MergeOperands
;
pub
use
metadata
::{
ColumnFamilyMetaData
,
LevelMetaData
,
SstFileMetaData
};
...
...
src/titan.rs
View file @
74947e8e
...
...
@@ -2,7 +2,7 @@ use std::ffi::{CStr, CString};
use
std
::
ops
::
Deref
;
use
crocksdb_ffi
::{
self
,
DBCompressionType
,
DBTitanBlobIndex
,
DBTitanDBOptions
};
use
librocksdb_sys
::
ctitandb_encode_blob_index
;
use
librocksdb_sys
::
{
ctitandb_encode_blob_index
,
DBTitanDBBlobRunMode
}
;
use
rocksdb
::
Cache
;
use
rocksdb_options
::
LRUCacheOptions
;
use
std
::
ops
::
DerefMut
;
...
...
@@ -117,6 +117,12 @@ impl TitanDBOptions {
crocksdb_ffi
::
ctitandb_options_set_merge_small_file_threshold
(
self
.inner
,
size
);
}
}
pub
fn
set_blob_run_mode
(
&
mut
self
,
t
:
DBTitanDBBlobRunMode
)
{
unsafe
{
crocksdb_ffi
::
ctitandb_options_set_blob_run_mode
(
self
.inner
,
t
);
}
}
}
impl
Drop
for
TitanDBOptions
{
...
...
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