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/01 02:39:08 UTC

[inlong] branch master updated: [INLONG-5756][Manager] Change the condition of the accept method for SortConfigListener (#5757)

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 fbe5b0157 [INLONG-5756][Manager] Change the condition of the accept method for SortConfigListener (#5757)
fbe5b0157 is described below

commit fbe5b0157034f1f6e6162304104de1b213605b40
Author: healchow <he...@gmail.com>
AuthorDate: Thu Sep 1 10:39:03 2022 +0800

    [INLONG-5756][Manager] Change the condition of the accept method for SortConfigListener (#5757)
---
 .../service/listener/sort/SortConfigListener.java  | 22 +++++-----------------
 1 file changed, 5 insertions(+), 17 deletions(-)

diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/sort/SortConfigListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/sort/SortConfigListener.java
index bf8f04e3d..88064c89f 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/sort/SortConfigListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/sort/SortConfigListener.java
@@ -17,7 +17,6 @@
 
 package org.apache.inlong.manager.service.listener.sort;
 
-import org.apache.inlong.manager.common.consts.InlongConstants;
 import org.apache.inlong.manager.common.enums.GroupOperateType;
 import org.apache.inlong.manager.common.exceptions.WorkflowListenerException;
 import org.apache.inlong.manager.pojo.group.InlongGroupInfo;
@@ -58,24 +57,13 @@ public class SortConfigListener implements SortOperateListener {
     @Override
     public boolean accept(WorkflowContext context) {
         ProcessForm processForm = context.getProcessForm();
+        String className = processForm.getClass().getSimpleName();
         String groupId = processForm.getInlongGroupId();
-        if (processForm instanceof GroupResourceProcessForm) {
-            GroupResourceProcessForm groupResourceForm = (GroupResourceProcessForm) processForm;
-            InlongGroupInfo groupInfo = groupResourceForm.getGroupInfo();
-            boolean enable = InlongConstants.DISABLE_ZK.equals(groupInfo.getEnableZookeeper());
-
-            LOGGER.info("zookeeper disabled was [{}] for groupId [{}]", enable, groupId);
-            return enable;
-        } else if (processForm instanceof StreamResourceProcessForm) {
-            StreamResourceProcessForm streamResourceForm = (StreamResourceProcessForm) processForm;
-            InlongGroupInfo groupInfo = streamResourceForm.getGroupInfo();
-            InlongStreamInfo streamInfo = streamResourceForm.getStreamInfo();
-            boolean enable = InlongConstants.DISABLE_ZK.equals(groupInfo.getEnableZookeeper());
-            LOGGER.info("zookeeper disabled was [{}] for groupId [{}] and streamId [{}] ", enable, groupId,
-                    streamInfo.getInlongStreamId());
-            return enable;
+        if (processForm instanceof GroupResourceProcessForm || processForm instanceof StreamResourceProcessForm) {
+            LOGGER.info("accept sort config listener as the process is {} for groupId [{}]", className, groupId);
+            return true;
         } else {
-            LOGGER.info("zk disabled for groupId [{}]", groupId);
+            LOGGER.info("not accept sort config listener as the process is {} for groupId [{}]", className, groupId);
             return false;
         }
     }