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 9643caa1b [INLONG-7593][Manager] Change the InlongGroup status when 
executing Sort and Queue listeners (#7596)
9643caa1b is described below

commit 9643caa1b65361776c35fa72cf345c187f33a806
Author: fuweng11 <[email protected]>
AuthorDate: Wed Mar 15 14:09:10 2023 +0800

    [INLONG-7593][Manager] Change the InlongGroup status when executing Sort 
and Queue listeners (#7596)
---
 .../manager/service/listener/queue/QueueResourceListener.java    | 3 ++-
 .../inlong/manager/service/listener/sort/SortConfigListener.java | 9 ++++++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/queue/QueueResourceListener.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/queue/QueueResourceListener.java
index 1b544b2a6..c8408420b 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/queue/QueueResourceListener.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/listener/queue/QueueResourceListener.java
@@ -104,7 +104,6 @@ public class QueueResourceListener implements 
QueueOperateListener {
         GroupResourceProcessForm groupProcessForm = (GroupResourceProcessForm) 
context.getProcessForm();
         final String groupId = groupProcessForm.getInlongGroupId();
         // ensure the inlong group exists
-        groupService.updateStatus(groupId, GroupStatus.CONFIG_ING.getCode(), 
context.getOperator());
         InlongGroupInfo groupInfo = groupService.get(groupId);
         if (groupInfo == null) {
             String msg = "inlong group not found with groupId=" + groupId;
@@ -125,12 +124,14 @@ public class QueueResourceListener implements 
QueueOperateListener {
         String operator = context.getOperator();
         switch (operateType) {
             case INIT:
+                groupService.updateStatus(groupId, 
GroupStatus.CONFIG_ING.getCode(), operator);
                 // create queue resource for inlong group
                 queueOperator.createQueueForGroup(groupInfo, operator);
                 // create queue resource for all inlong streams under the 
inlong group
                 this.createQueueForStreams(groupInfo, 
groupProcessForm.getStreamInfos(), operator);
                 break;
             case DELETE:
+                groupService.updateStatus(groupId, 
GroupStatus.DELETING.getCode(), operator);
                 queueOperator.deleteQueueForGroup(groupInfo, operator);
                 break;
             default:
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 e15c8a803..96a00d661 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
@@ -88,7 +88,14 @@ public class SortConfigListener implements 
SortOperateListener {
             return ListenerResult.success();
         }
         // ensure the inlong group exists
-        groupService.updateStatus(groupId, GroupStatus.CONFIG_ING.getCode(), 
context.getOperator());
+        switch (operateType) {
+            case INIT:
+                groupService.updateStatus(groupId, 
GroupStatus.CONFIG_ING.getCode(), context.getOperator());
+                break;
+            case RESTART:
+                groupService.updateStatus(groupId, 
GroupStatus.RESTARTING.getCode(), context.getOperator());
+                break;
+        }
         InlongGroupInfo groupInfo = groupService.get(groupId);
         if (groupInfo == null) {
             String msg = "inlong group not found with groupId=" + groupId;

Reply via email to