You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/06/18 02:10:21 UTC

[incubator-inlong] branch master updated: [INLONG-4676][Manager] Optimize init process of inlong group in the client (#4692)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 64e2b109e [INLONG-4676][Manager] Optimize init process of inlong group in the client (#4692)
64e2b109e is described below

commit 64e2b109e50c26eb0845fedc4375b35a0e370118
Author: kipshi <48...@users.noreply.github.com>
AuthorDate: Sat Jun 18 10:10:16 2022 +0800

    [INLONG-4676][Manager] Optimize init process of inlong group in the client (#4692)
---
 .../inlong/manager/client/api/enums/SimpleGroupStatus.java   |  2 +-
 .../org/apache/inlong/manager/common/enums/GroupStatus.java  |  6 ++++--
 .../listener/light/LightGroupUpdateCompleteListener.java     | 12 ++----------
 3 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/enums/SimpleGroupStatus.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/enums/SimpleGroupStatus.java
index fa3ea039b..63a017488 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/enums/SimpleGroupStatus.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/enums/SimpleGroupStatus.java
@@ -40,6 +40,7 @@ public enum SimpleGroupStatus {
         switch (groupStatus) {
             case DRAFT:
             case TO_BE_SUBMIT:
+            case TO_BE_APPROVAL:
                 return CREATE;
             case DELETING:
             case SUSPENDING:
@@ -47,7 +48,6 @@ public enum SimpleGroupStatus {
                 return OPERATING;
             case APPROVE_REJECTED:
                 return REJECTED;
-            case TO_BE_APPROVAL:
             case APPROVE_PASSED:
             case CONFIG_ING:
                 return INITIALIZING;
diff --git a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/GroupStatus.java b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/GroupStatus.java
index d42ed9bde..51fc52268 100644
--- a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/GroupStatus.java
+++ b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/enums/GroupStatus.java
@@ -109,7 +109,8 @@ public enum GroupStatus {
      * Checks whether the given status allows the update.
      */
     public static boolean notAllowedUpdate(GroupStatus status) {
-        return status == GroupStatus.CONFIG_ING || status == GroupStatus.TO_BE_APPROVAL;
+        return status == GroupStatus.CONFIG_ING || status == GroupStatus.SUSPENDING
+                || status == GroupStatus.RESTARTING || status == GroupStatus.DELETING;
     }
 
     /**
@@ -126,7 +127,8 @@ public enum GroupStatus {
      */
     public static boolean notAllowedUpdateMQ(GroupStatus status) {
         return status != GroupStatus.DRAFT && status != GroupStatus.TO_BE_SUBMIT
-                && status != GroupStatus.APPROVE_REJECTED && status != GroupStatus.CONFIG_FAILED;
+                && status != GroupStatus.TO_BE_APPROVAL && status != GroupStatus.APPROVE_REJECTED
+                && status != GroupStatus.CONFIG_FAILED;
     }
 
     /**
diff --git a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/light/LightGroupUpdateCompleteListener.java b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/light/LightGroupUpdateCompleteListener.java
index d110f1fcf..44210e186 100644
--- a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/light/LightGroupUpdateCompleteListener.java
+++ b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/workflow/group/listener/light/LightGroupUpdateCompleteListener.java
@@ -18,14 +18,12 @@
 package org.apache.inlong.manager.service.workflow.group.listener.light;
 
 import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.collections.CollectionUtils;
 import org.apache.inlong.manager.common.enums.GroupOperateType;
 import org.apache.inlong.manager.common.enums.GroupStatus;
 import org.apache.inlong.manager.common.enums.SourceStatus;
-import org.apache.inlong.manager.common.pojo.stream.InlongStreamInfo;
 import org.apache.inlong.manager.common.pojo.workflow.form.LightGroupResourceProcessForm;
-import org.apache.inlong.manager.service.group.InlongGroupService;
 import org.apache.inlong.manager.service.core.InlongStreamService;
+import org.apache.inlong.manager.service.group.InlongGroupService;
 import org.apache.inlong.manager.service.source.StreamSourceService;
 import org.apache.inlong.manager.workflow.WorkflowContext;
 import org.apache.inlong.manager.workflow.event.ListenerResult;
@@ -34,8 +32,6 @@ import org.apache.inlong.manager.workflow.event.process.ProcessEventListener;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.List;
-
 /**
  * Listener of light group update complete.
  */
@@ -77,11 +73,7 @@ public class LightGroupUpdateCompleteListener implements ProcessEventListener {
             default:
                 break;
         }
-
-        if (CollectionUtils.isEmpty(form.getStreamInfos())) {
-            List<InlongStreamInfo> streamInfos = streamService.list(groupId);
-            form.setStreamInfos(streamInfos);
-        }
+        groupService.update(form.getGroupInfo().genRequest(), applicant);
         return ListenerResult.success();
     }