@ -195,11 +195,11 @@ bool LDBCommand::ParseIntOption(const map<string, string>& options,
value = stoi ( itr - > second ) ;
return true ;
} catch ( const invalid_argument & ) {
exec_state = LDBCommandExecuteResult : : Failed ( option +
" has an invalid value. " ) ;
exec_state =
LDBCommandExecuteResult : : Failed ( option + " has an invalid value. " ) ;
} catch ( const out_of_range & ) {
exec_state = LDBCommandExecuteResult : : Failed ( option +
" has a value out-of-range. " ) ;
exec_state = LDBCommandExecuteResult : : Failed (
option + " has a value out-of-range. " ) ;
}
}
return false ;
@ -235,8 +235,8 @@ Options LDBCommand::PrepareOptionsForOpenDB() {
use_table_options = true ;
table_options . filter_policy . reset ( NewBloomFilterPolicy ( bits ) ) ;
} else {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_BLOOM_BITS +
" must be > 0. " ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( ARG_BLOOM_BITS + " must be > 0. " ) ;
}
}
@ -246,8 +246,8 @@ Options LDBCommand::PrepareOptionsForOpenDB() {
use_table_options = true ;
table_options . block_size = block_size ;
} else {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_BLOCK_SIZE +
" must be > 0. " ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( ARG_BLOCK_SIZE + " must be > 0. " ) ;
}
}
@ -277,8 +277,8 @@ Options LDBCommand::PrepareOptionsForOpenDB() {
opt . compression = kLZ4HCCompression ;
} else {
// Unknown compression.
exec_state_ = LDBCommandExecuteResult : : Failed (
" Unknown compression level: " + comp ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( " Unknown compression level: " + comp ) ;
}
}
@ -309,8 +309,8 @@ Options LDBCommand::PrepareOptionsForOpenDB() {
if ( file_size > 0 ) {
opt . target_file_size_base = file_size ;
} else {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_FILE_SIZE +
" must be > 0. " ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( ARG_FILE_SIZE + " must be > 0. " ) ;
}
}
@ -585,8 +585,8 @@ void ManifestDumpCommand::DoCommand() {
// containing the db for files of the form MANIFEST_[0-9]+
DIR * d = opendir ( db_path_ . c_str ( ) ) ;
if ( d = = nullptr ) {
exec_state_ = LDBCommandExecuteResult : : Failed (
db_path_ + " is not a directory " ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( db_path_ + " is not a directory " ) ;
return ;
}
struct dirent * entry ;
@ -792,8 +792,8 @@ void InternalDumpCommand::DoCommand() {
ScopedArenaIterator iter ( idb - > TEST_NewInternalIterator ( & arena ) ) ;
Status st = iter - > status ( ) ;
if ( ! st . ok ( ) ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( " Iterator error: "
+ st . ToString ( ) ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( " Iterator error: " + st . ToString ( ) ) ;
}
if ( has_from_ ) {
@ -902,8 +902,8 @@ DBDumperCommand::DBDumperCommand(const vector<string>& params,
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_MAX_KEYS +
" has an invalid value " ) ;
} catch ( const out_of_range & ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_MAX_KEYS +
" has a value out-of-range " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
ARG_MAX_KEYS + " has a value out-of-range " ) ;
}
}
itr = options . find ( ARG_COUNT_DELIM ) ;
@ -961,8 +961,8 @@ void DBDumperCommand::DoCommand() {
Iterator * iter = db_ - > NewIterator ( ReadOptions ( ) ) ;
Status st = iter - > status ( ) ;
if ( ! st . ok ( ) ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( " Iterator error. "
+ st . ToString ( ) ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( " Iterator error. " + st . ToString ( ) ) ;
}
if ( ! null_from_ ) {
@ -1165,8 +1165,8 @@ Status ReduceDBLevelsCommand::GetOldNumOfLevels(Options& opt,
void ReduceDBLevelsCommand : : DoCommand ( ) {
if ( new_levels_ < = 1 ) {
exec_state_ = LDBCommandExecuteResult : : Failed (
" Invalid number of levels. \n " ) ;
exec_state_ =
LDBCommandExecuteResult : : Failed ( " Invalid number of levels. \n " ) ;
return ;
}
@ -1320,16 +1320,19 @@ void ChangeCompactionStyleCommand::DoCommand() {
// level 0 should have only 1 file
if ( i = = 0 & & num_files ! = 1 ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( " Number of db files at "
" level 0 after compaction is " + ToString ( num_files ) +
" , not 1. \n " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
" Number of db files at "
" level 0 after compaction is " +
ToString ( num_files ) + " , not 1. \n " ) ;
return ;
}
// other levels should have no file
if ( i > 0 & & num_files ! = 0 ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( " Number of db files at "
" level " + ToString ( i ) + " after compaction is " +
ToString ( num_files ) + " , not 0. \n " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
" Number of db files at "
" level " +
ToString ( i ) + " after compaction is " + ToString ( num_files ) +
" , not 0. \n " ) ;
return ;
}
}
@ -1459,8 +1462,8 @@ WALDumperCommand::WALDumperCommand(const vector<string>& params,
print_header_ = IsFlagPresent ( flags , ARG_PRINT_HEADER ) ;
print_values_ = IsFlagPresent ( flags , ARG_PRINT_VALUE ) ;
if ( wal_file_ . empty ( ) ) {
exec_state_ = LDBCommandExecuteResult : : Failed (
" Argument " + ARG_WAL_FILE + " must be specified. " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed ( " Argument " + ARG_WAL_FILE +
" must be specified. " ) ;
}
}
@ -1527,16 +1530,16 @@ ApproxSizeCommand::ApproxSizeCommand(const vector<string>& params,
if ( options . find ( ARG_FROM ) ! = options . end ( ) ) {
start_key_ = options . find ( ARG_FROM ) - > second ;
} else {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_FROM +
" must be specified for approxsize command " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
ARG_FROM + " must be specified for approxsize command " ) ;
return ;
}
if ( options . find ( ARG_TO ) ! = options . end ( ) ) {
end_key_ = options . find ( ARG_TO ) - > second ;
} else {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_TO +
" must be specified for approxsize command " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
ARG_TO + " must be specified for approxsize command " ) ;
return ;
}
@ -1659,8 +1662,8 @@ ScanCommand::ScanCommand(const vector<string>& params,
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_MAX_KEYS +
" has an invalid value " ) ;
} catch ( const out_of_range & ) {
exec_state_ = LDBCommandExecuteResult : : Failed ( ARG_MAX_KEYS +
" has a value out-of-range " ) ;
exec_state_ = LDBCommandExecuteResult : : Failed (
ARG_MAX_KEYS + " has a value out-of-range " ) ;
}
}
}