diff --git a/cpp/CHANGELOG.md b/cpp/CHANGELOG.md index ce3957e82192a1d809a127740059a69f525476ca..12906a4b6d48afeced78a738e9ca6d616b1848f3 100644 --- a/cpp/CHANGELOG.md +++ b/cpp/CHANGELOG.md @@ -8,6 +8,7 @@ Please mark all change in change log and use the ticket from JIRA. - MS-411 - Fix metric unittest linking error - MS-412 - Fix gpu cache logical error - MS-416 - ExecutionEngineImpl::GpuCache has not return value cause crash +- MS-417 - YAML sequence load disable cause scheduler startup failed ## Improvement - MS-327 - Clean code for milvus diff --git a/cpp/src/config/YamlConfigMgr.cpp b/cpp/src/config/YamlConfigMgr.cpp index ee935bf32ccf460fe128afc7de3738401b593667..9a34ef3e63c978c184d859cc5b3dc6997ab7ac06 100644 --- a/cpp/src/config/YamlConfigMgr.cpp +++ b/cpp/src/config/YamlConfigMgr.cpp @@ -73,19 +73,19 @@ YamlConfigMgr::SetChildConfig(const YAML::Node& node, return false; } -//bool -//YamlConfigMgr::SetSequence(const YAML::Node &node, -// const std::string &child_name, -// ConfigNode &config) { -// if(node[child_name].IsDefined ()) { -// size_t cnt = node[child_name].size(); -// for(size_t i = 0; i < cnt; i++){ -// config.AddSequenceItem(child_name, node[child_name][i].as()); -// } -// return true; -// } -// return false; -//} +bool +YamlConfigMgr::SetSequence(const YAML::Node &node, + const std::string &child_name, + ConfigNode &config) { + if(node[child_name].IsDefined ()) { + size_t cnt = node[child_name].size(); + for(size_t i = 0; i < cnt; i++){ + config.AddSequenceItem(child_name, node[child_name][i].as()); + } + return true; + } + return false; +} void YamlConfigMgr::LoadConfigNode(const YAML::Node& node, ConfigNode& config) { @@ -98,8 +98,8 @@ YamlConfigMgr::LoadConfigNode(const YAML::Node& node, ConfigNode& config) { SetConfigValue(node, key, config); } else if(node[key].IsMap()){ SetChildConfig(node, key, config); -// } else if(node[key].IsSequence()){ -// SetSequence(node, key, config); + } else if(node[key].IsSequence()){ + SetSequence(node, key, config); } } } diff --git a/cpp/src/config/YamlConfigMgr.h b/cpp/src/config/YamlConfigMgr.h index 05b55d9da526e64e05c597386b9ab4f6cd11145c..b8828b7a8c297598f3500ca21a86943c9b21e957 100644 --- a/cpp/src/config/YamlConfigMgr.h +++ b/cpp/src/config/YamlConfigMgr.h @@ -33,10 +33,10 @@ class YamlConfigMgr : public IConfigMgr { const std::string &name, ConfigNode &config); -// bool -// SetSequence(const YAML::Node &node, -// const std::string &child_name, -// ConfigNode &config); + bool + SetSequence(const YAML::Node &node, + const std::string &child_name, + ConfigNode &config); void LoadConfigNode(const YAML::Node& node, ConfigNode& config);