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
77575fa7
Unverified
Commit
77575fa7
authored
Nov 10, 2018
by
Tong Zhigao
Committed by
GitHub
Nov 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add run_ldb_tool; (#232)
Signed-off-by:
Tong Zhigao
<
tongzhigao@pingcap.com
>
parent
5c9bcda8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
3 deletions
+26
-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
+1
-0
lib.rs
src/lib.rs
+3
-3
rocksdb.rs
src/rocksdb.rs
+14
-0
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
77575fa7
...
...
@@ -17,6 +17,7 @@
#include "rocksdb/env.h"
#include "rocksdb/filter_policy.h"
#include "rocksdb/iterator.h"
#include "rocksdb/ldb_tool.h"
#include "rocksdb/listener.h"
#include "rocksdb/memtablerep.h"
#include "rocksdb/merge_operator.h"
...
...
@@ -145,6 +146,7 @@ using rocksdb::CompactionOptions;
using
rocksdb
::
PerfLevel
;
using
rocksdb
::
PerfContext
;
using
rocksdb
::
BottommostLevelCompaction
;
using
rocksdb
::
LDBTool
;
using
std
::
shared_ptr
;
...
...
@@ -4680,4 +4682,8 @@ uint64_t crocksdb_perf_context_env_new_logger_nanos(crocksdb_perf_context_t* ctx
return
ctx
->
rep
.
env_new_logger_nanos
;
}
void
crocksdb_run_ldb_tool
(
int
argc
,
char
**
argv
)
{
LDBTool
().
Run
(
argc
,
argv
);
}
}
// end extern "C"
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
77575fa7
...
...
@@ -1882,6 +1882,8 @@ extern C_ROCKSDB_LIBRARY_API uint64_t
crocksdb_perf_context_env_unlock_file_nanos
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_env_new_logger_nanos
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_run_ldb_tool
(
int
argc
,
char
**
argv
);
#ifdef __cplusplus
}
/* end extern "C" */
...
...
librocksdb_sys/src/lib.rs
View file @
77575fa7
...
...
@@ -1674,6 +1674,7 @@ extern "C" {
pub
fn
crocksdb_perf_context_env_lock_file_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_env_unlock_file_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_env_new_logger_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_run_ldb_tool
(
argc
:
c_int
,
argv
:
*
const
*
const
c_char
);
}
#[cfg(test)]
...
...
src/lib.rs
View file @
77575fa7
...
...
@@ -33,9 +33,9 @@ pub use merge_operator::MergeOperands;
pub
use
metadata
::{
ColumnFamilyMetaData
,
LevelMetaData
,
SstFileMetaData
};
pub
use
perf_context
::{
get_perf_level
,
set_perf_level
,
PerfContext
,
PerfLevel
};
pub
use
rocksdb
::{
load_latest_options
,
set_external_sst_file_global_seq_no
,
BackupEngine
,
CFHandle
,
DBIterator
,
DB
Vector
,
Env
,
ExternalSstFileInfo
,
Kv
,
Range
,
SeekKey
,
SequentialFile
,
SstFileWriter
,
Writable
,
WriteBatch
,
DB
,
load_latest_options
,
run_ldb_tool
,
set_external_sst_file_global_seq_no
,
BackupEngine
,
CFHandle
,
DB
Iterator
,
DBVector
,
Env
,
ExternalSstFileInfo
,
Kv
,
Range
,
SeekKey
,
SequentialFile
,
SstFileWriter
,
Writable
,
WriteBatch
,
DB
,
};
pub
use
rocksdb_options
::{
BlockBasedOptions
,
CColumnFamilyDescriptor
,
ColumnFamilyOptions
,
CompactOptions
,
...
...
src/rocksdb.rs
View file @
77575fa7
...
...
@@ -2204,6 +2204,20 @@ pub fn load_latest_options(
}
}
pub
fn
run_ldb_tool
(
ldb_args
:
&
Vec
<
String
>
)
{
unsafe
{
let
ldb_args_cstrs
:
Vec
<
_
>
=
ldb_args
.iter
()
.map
(|
s
|
CString
::
new
(
s
.as_bytes
())
.unwrap
())
.collect
();
let
args
:
Vec
<
_
>
=
ldb_args_cstrs
.iter
()
.map
(|
s
|
s
.as_ptr
())
.collect
();
crocksdb_ffi
::
crocksdb_run_ldb_tool
(
args
.len
()
as
i32
,
args
.as_ptr
()
as
*
const
*
const
c_char
,
);
}
}
#[cfg(test)]
mod
test
{
use
super
::
*
;
...
...
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