}
Client::command_result_t
-Client::run_command(const std::vector<std::string>& cmd,
- const bufferlist& bl)
+Client::run_command(std::string&& cmd,
+ bufferlist&& bl)
{
auto m = make_message<MMonCommand>(monmap.fsid);
auto tid = ++last_mon_command_id;
m->set_tid(tid);
- m->cmd = cmd;
- m->set_data(bl);
+ m->cmd = {std::move(cmd)};
+ m->set_data(std::move(bl));
auto& req = mon_commands[tid];
return send_message(m).then([&req] {
return req.get_future();
return monmap.fsid;
}
get_version_t get_version(const std::string& map);
- command_result_t run_command(const std::vector<std::string>& cmd,
- const bufferlist& bl);
+ command_result_t run_command(std::string&& cmd,
+ bufferlist&& bl);
seastar::future<> send_message(MessageRef);
bool sub_want(const std::string& what, version_t start, unsigned flags);
void sub_got(const std::string& what, version_t have);
"weight": {:.4f},
"args": [{}]
}})", whoami, weight, loc);
- return monc->run_command({cmd}, {});
+ return monc->run_command(std::move(cmd), {});
}).then([](auto&& command_result) {
[[maybe_unused]] auto [code, message, out] = std::move(command_result);
if (code) {