Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support singleton input #1933

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

feat: support singleton input #1933

wants to merge 11 commits into from

Conversation

Abingcbc
Copy link
Collaborator

@Abingcbc Abingcbc commented Nov 28, 2024

  1. 加载流水线时,对只能存在一个实例的input进行限制
  2. 对加载的配置顺序进行排序,保证先创建的配置,先加载流水线

core/pipeline/plugin/PluginRegistry.h Outdated Show resolved Hide resolved
core/pipeline/plugin/PluginRegistry.cpp Show resolved Hide resolved
core/pipeline/PipelineManager.cpp Outdated Show resolved Hide resolved
core/pipeline/PipelineManager.h Outdated Show resolved Hide resolved
core/pipeline/PipelineManager.cpp Outdated Show resolved Hide resolved
core/config/watcher/PipelineConfigWatcher.cpp Outdated Show resolved Hide resolved
@@ -80,6 +80,22 @@ bool IsConfigEnabled(const string& name, const Json::Value& detail) {
return true;
}

void GetAllInputTypes(const Json::Value& detail, std::vector<string>& inputTypes) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没调用点?

{
"inputs": [
{
"Type": "input_network_observer"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多input的行为是什么,也需要有用例覆盖

@@ -238,10 +241,10 @@ bool PipelineConfig::Parse() {
}
}
// TODO: remove these special restrictions
if (hasFileInput && (*mDetail)["inputs"].size() > 1) {
if ((hasFileInput || !mSingletonInput.empty()) && (*mDetail)["inputs"].size() > 1) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉还是把判断放上面吧。因为文件这个限制肯定是要去掉的。

可以跟笃敏再确认下

private:
};

void PipelineConfigWatcherUnittest::TestPushPipelineConfig() const {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要给下测试用例设计,一些边界的组合需要考虑全面

"skip current object")("config", config.mName)("inputType", config.mSingletonInput));
return;
}
if (mPipelineManager->FindConfigByName(it->second->config.mName)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如交流生效的处理有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants