You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by go...@apache.org on 2022/03/15 13:51:55 UTC

[incubator-inlong] branch master updated: [INLONG-3152][Manager] Throw exception when group is in initialization (#3153)

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

gosonzhang 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 56d9fed  [INLONG-3152][Manager] Throw exception when group is in initialization (#3153)
56d9fed is described below

commit 56d9fed022cf8f5b069a2848cd6efc8d5952604e
Author: kipshi <48...@users.noreply.github.com>
AuthorDate: Tue Mar 15 21:49:57 2022 +0800

    [INLONG-3152][Manager] Throw exception when group is in initialization (#3153)
---
 .../org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java
index 17fc05c..413ba45 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java
@@ -126,6 +126,11 @@ public class InlongGroupImpl implements InlongGroup {
         } else {
             conf = this.groupConf;
         }
+        final String groupId = "b_" + conf.getGroupName();
+        InlongGroupResponse groupResponse = managerClient.getGroupInfo(groupId);
+        InlongGroupState state = InlongGroupState.parseByBizStatus(groupResponse.getStatus());
+        AssertUtil.isTrue(state != InlongGroupState.INITIALIZING,
+                "Inlong Group is in init state, should not be updated");
         InlongGroupInfo groupInfo = InlongGroupTransfer.createGroupInfo(conf);
         InlongGroupRequest groupRequest = groupInfo.genRequest();
         Pair<String, String> idAndErr = managerClient.updateGroup(groupRequest);