mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 19:08:30 +08:00
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:
parent
41d7500f61
commit
21e986d130
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user