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
7bcf58d4
Unverified
Commit
7bcf58d4
authored
Apr 13, 2020
by
Connor
Committed by
GitHub
Apr 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add API to run sst dump tool (#470)
* add run sst dump Signed-off-by:
Connor
<
zbk602423539@gmail.com
>
parent
922e8342
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
3 deletions
+32
-3
c.cc
librocksdb_sys/crocksdb/c.cc
+6
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+2
-0
lib.rs
librocksdb_sys/src/lib.rs
+5
-0
lib.rs
src/lib.rs
+4
-3
rocksdb.rs
src/rocksdb.rs
+15
-0
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
7bcf58d4
...
...
@@ -26,6 +26,7 @@
#include "rocksdb/iostats_context.h"
#include "rocksdb/iterator.h"
#include "rocksdb/ldb_tool.h"
#include "rocksdb/sst_dump_tool.h"
#include "rocksdb/listener.h"
#include "rocksdb/memtablerep.h"
#include "rocksdb/merge_operator.h"
...
...
@@ -163,6 +164,7 @@ using rocksdb::PerfContext;
using
rocksdb
::
IOStatsContext
;
using
rocksdb
::
BottommostLevelCompaction
;
using
rocksdb
::
LDBTool
;
using
rocksdb
::
SSTDumpTool
;
using
rocksdb
::
kMaxSequenceNumber
;
...
...
@@ -5488,6 +5490,10 @@ void crocksdb_run_ldb_tool(int argc, char** argv, const crocksdb_options_t* opts
LDBTool
().
Run
(
argc
,
argv
,
opts
->
rep
);
}
void
crocksdb_run_sst_dump_tool
(
int
argc
,
char
**
argv
,
const
crocksdb_options_t
*
opts
)
{
SSTDumpTool
().
Run
(
argc
,
argv
,
opts
->
rep
);
}
/* Titan */
struct
ctitandb_options_t
{
TitanOptions
rep
;
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
7bcf58d4
...
...
@@ -2139,6 +2139,8 @@ crocksdb_iostats_context_logger_nanos(crocksdb_iostats_context_t*);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_run_ldb_tool
(
int
argc
,
char
**
argv
,
const
crocksdb_options_t
*
opts
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_run_sst_dump_tool
(
int
argc
,
char
**
argv
,
const
crocksdb_options_t
*
opts
);
/* Titan */
struct
ctitandb_blob_index_t
{
...
...
librocksdb_sys/src/lib.rs
View file @
7bcf58d4
...
...
@@ -2168,6 +2168,11 @@ extern "C" {
pub
fn
crocksdb_iostats_context_logger_nanos
(
ctx
:
*
mut
DBIOStatsContext
)
->
u64
;
pub
fn
crocksdb_run_ldb_tool
(
argc
:
c_int
,
argv
:
*
const
*
const
c_char
,
opts
:
*
const
Options
);
pub
fn
crocksdb_run_sst_dump_tool
(
argc
:
c_int
,
argv
:
*
const
*
const
c_char
,
opts
:
*
const
Options
,
);
}
// Titan
...
...
src/lib.rs
View file @
7bcf58d4
...
...
@@ -46,9 +46,10 @@ pub use merge_operator::MergeOperands;
pub
use
metadata
::{
ColumnFamilyMetaData
,
LevelMetaData
,
SstFileMetaData
};
pub
use
perf_context
::{
get_perf_level
,
set_perf_level
,
IOStatsContext
,
PerfContext
,
PerfLevel
};
pub
use
rocksdb
::{
load_latest_options
,
run_ldb_tool
,
set_external_sst_file_global_seq_no
,
BackupEngine
,
CFHandle
,
Cache
,
DBIterator
,
DBVector
,
Env
,
ExternalSstFileInfo
,
MapProperty
,
MemoryAllocator
,
Range
,
SeekKey
,
SequentialFile
,
SstFileReader
,
SstFileWriter
,
Writable
,
WriteBatch
,
DB
,
load_latest_options
,
run_ldb_tool
,
run_sst_dump_tool
,
set_external_sst_file_global_seq_no
,
BackupEngine
,
CFHandle
,
Cache
,
DBIterator
,
DBVector
,
Env
,
ExternalSstFileInfo
,
MapProperty
,
MemoryAllocator
,
Range
,
SeekKey
,
SequentialFile
,
SstFileReader
,
SstFileWriter
,
Writable
,
WriteBatch
,
DB
,
};
pub
use
rocksdb_options
::{
BlockBasedOptions
,
CColumnFamilyDescriptor
,
ColumnFamilyOptions
,
CompactOptions
,
...
...
src/rocksdb.rs
View file @
7bcf58d4
...
...
@@ -2747,6 +2747,21 @@ pub fn run_ldb_tool(ldb_args: &[String], opts: &DBOptions) {
}
}
pub
fn
run_sst_dump_tool
(
sst_dump_args
:
&
[
String
],
opts
:
&
DBOptions
)
{
unsafe
{
let
sst_dump_args_cstrs
:
Vec
<
_
>
=
sst_dump_args
.iter
()
.map
(|
s
|
CString
::
new
(
s
.as_bytes
())
.unwrap
())
.collect
();
let
args
:
Vec
<
_
>
=
sst_dump_args_cstrs
.iter
()
.map
(|
s
|
s
.as_ptr
())
.collect
();
crocksdb_ffi
::
crocksdb_run_sst_dump_tool
(
args
.len
()
as
i32
,
args
.as_ptr
()
as
*
const
*
const
c_char
,
opts
.inner
,
);
}
}
#[cfg(test)]
mod
test
{
use
std
::
fs
;
...
...
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