You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by do...@apache.org on 2022/09/10 04:31:05 UTC

[inlong] branch master updated: [INLONG-5844][Manager] Sub sources should be filtered when querying task status (#5845)

This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c797ebe3 [INLONG-5844][Manager] Sub sources should be filtered when querying task status (#5845)
9c797ebe3 is described below

commit 9c797ebe35b8e66b8541d4844f7d9c6612b74b95
Author: woofyzhao <49...@qq.com>
AuthorDate: Sat Sep 10 12:31:01 2022 +0800

    [INLONG-5844][Manager] Sub sources should be filtered when querying task status (#5845)
    
    Co-authored-by: healchow <he...@gmail.com>
---
 .../java/org/apache/inlong/manager/client/api/InlongGroupContext.java | 4 +++-
 .../main/java/org/apache/inlong/manager/pojo/source/StreamSource.java | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongGroupContext.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongGroupContext.java
index 3ba3a0aec..52cca26a7 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongGroupContext.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/InlongGroupContext.java
@@ -90,7 +90,9 @@ public class InlongGroupContext implements Serializable {
             if (MapUtils.isNotEmpty(sources)) {
                 for (Map.Entry<String, StreamSource> entry : sources.entrySet()) {
                     StreamSource source = entry.getValue();
-                    if (source != null) {
+                    // when template id is null it is considered as normal source other than template source
+                    // sub sources are filtered because they are already collected in template source's sub source list
+                    if (source != null && source.getTemplateId() == null) {
                         groupSources.add(source);
                     }
                 }
diff --git a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/StreamSource.java b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/StreamSource.java
index 9c07d7969..a95dd6d5b 100644
--- a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/StreamSource.java
+++ b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/source/StreamSource.java
@@ -104,6 +104,9 @@ public abstract class StreamSource extends StreamNode {
     @Builder.Default
     private Map<String, Object> properties = new LinkedHashMap<>();
 
+    @ApiModelProperty("Null if not a sub source")
+    private Integer templateId;
+
     @ApiModelProperty("Sub source information of existing agents")
     private List<SubSourceDTO> subSourceList;