support config cli (#742)

* #665 support get/set config via CLI

* #665 support get/set config via CLI

* #665 add unittest for config CLI

* #665 remove config_node_map_

* #665 remove config_node_map_

* #665 fix clang-format

* #665 fix clang-format

* #665 update changelog

* #665 code clean

* #665 update API interface

* #665 update API interface

* #665 handle server status

* #665 handle unknown command

* #665 update debug log

* #665 support get/set config via CLI

* #665 support get/set config via CLI

* #665 add unittest for config CLI

* #665 remove config_node_map_

* #665 remove config_node_map_

* #665 fix clang-format

* #665 fix clang-format

* #665 update changelog

* #665 code clean

* #665 update API interface

* #665 update API interface

* #665 handle server status

* #665 handle unknown command

* #665 update debug log
This commit is contained in:
Cai Yudong 2019-12-14 17:01:56 +08:00 committed by Jin Hai
parent 41d7500f61
commit 21e986d130

View File

@ -38,9 +38,12 @@ Status
CmdRequest::OnExecute() {
std::string hdr = "CmdRequest(cmd=" + cmd_ + ")";
TimeRecorderAuto rc(hdr);
Status stat = Status::OK();
if (cmd_ == "version") {
result_ = MILVUS_VERSION;
} else if (cmd_ == "status") {
result_ = "OK";
} else if (cmd_ == "tasktable") {
result_ = scheduler::ResMgrInst::GetInstance()->DumpTaskTables();
} else if (cmd_ == "mode") {
@ -49,11 +52,14 @@ CmdRequest::OnExecute() {
#else
result_ = "CPU";
#endif
} else if (cmd_.substr(0, 3) == "set" || cmd_.substr(0, 3) == "get") {
server::Config& config = server::Config::GetInstance();
stat = config.HandleConfigCli(result_, cmd_);
} else {
result_ = "OK";
result_ = "Unknown command";
}
return Status::OK();
return stat;
}
} // namespace server