@ -12,10 +12,7 @@ namespace rocksdb {
LDBOptions : : LDBOptions ( ) { }
class LDBCommandRunner {
public :
static void PrintHelp ( const char * exec_name ) {
void LDBCommandRunner : : PrintHelp ( const char * exec_name ) {
std : : string ret ;
ret . append ( " ldb - LevelDB Tool " ) ;
@ -23,7 +20,8 @@ public:
ret . append ( " commands MUST specify -- " + LDBCommand : : ARG_DB +
" =<full_path_to_db_directory> when necessary \n " ) ;
ret . append ( " \n " ) ;
ret . append ( " The following optional parameters control if keys/values are "
ret . append (
" The following optional parameters control if keys/values are "
" input/output as hex or as plain strings: \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_KEY_HEX +
" : Keys are input/output as hex \n " ) ;
@ -37,7 +35,8 @@ public:
" family \n " ) ;
ret . append ( " \n " ) ;
ret . append ( " The following optional parameters control the database "
ret . append (
" The following optional parameters control the database "
" internals: \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_TTL +
" with 'put','get','scan','dump','query','batchput' "
@ -48,8 +47,7 @@ public:
" =<no|snappy|zlib|bzip2|lz4|lz4hc|xpress|zstd> \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_COMPRESSION_MAX_DICT_BYTES +
" =<int,e.g.:14> \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_BLOCK_SIZE +
" =<block_size_in_bytes> \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_BLOCK_SIZE + " =<block_size_in_bytes> \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_AUTO_COMPACTION + " =<true|false> \n " ) ;
ret . append ( " -- " + LDBCommand : : ARG_DB_WRITE_BUFFER_SIZE +
" =<int,e.g.:16777216> \n " ) ;
@ -83,9 +81,9 @@ public:
RepairCommand : : Help ( ret ) ;
fprintf ( stderr , " %s \n " , ret . c_str ( ) ) ;
}
}
static void RunCommand (
void LDBCommandRunner : : RunCommand (
int argc , char * * argv , Options options , const LDBOptions & ldb_options ,
const std : : vector < ColumnFamilyDescriptor > * column_families ) {
if ( argc < = 2 ) {
@ -111,9 +109,7 @@ public:
delete cmdObj ;
exit ( ret . IsFailed ( ) ) ;
}
} ;
}
void LDBTool : : Run ( int argc , char * * argv , Options options ,
const LDBOptions & ldb_options ,