Skip to content

Commit

Permalink
meta.dump
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Feb 20, 2024
1 parent b6f64f1 commit ac025e4
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/meta/server_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,13 @@ void server_state::register_cli_commands()
_cmds.emplace_back(dsn::command_manager::instance().register_single_command(
"meta.dump",
"Dump app_states of meta server to a local file",
"-t|--target target_file",
"<target_file>",
[this](const std::vector<std::string> &args) {
dsn::error_code err;
if (args.size() != 2) {
err = ERR_INVALID_PARAMETERS;
} else {
const char *target_file = nullptr;
for (int i = 0; i < args.size(); i += 2) {
if (args[i] == "-t" || args[i] == "--target")
target_file = args[i + 1].c_str();
}
if (target_file == nullptr) {
err = ERR_INVALID_PARAMETERS;
} else {
err = this->dump_from_remote_storage(target_file, false);
}
if (args.size() != 1) {
return ERR_INVALID_PARAMETERS.to_string();
}
return std::string(err.to_string());

return dump_from_remote_storage(args[0].c_str(), false).to_string();
}));

_cmds.emplace_back(dsn::command_manager::instance().register_bool_command(
Expand Down

0 comments on commit ac025e4

Please sign in to comment.