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/06 14:31:39 UTC

[incubator-inlong] branch master updated: [INLONG-4532][Manager] Fix init the sort config error in the client (#4533)

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 9ad1bc8c6 [INLONG-4532][Manager] Fix init the sort config error in the client (#4533)
9ad1bc8c6 is described below

commit 9ad1bc8c6d23b128f5b2a9465371fd1852018dee
Author: kipshi <48...@users.noreply.github.com>
AuthorDate: Mon Jun 6 22:31:33 2022 +0800

    [INLONG-4532][Manager] Fix init the sort config error in the client (#4533)
---
 .../org/apache/inlong/manager/client/api/impl/InlongGroupImpl.java    | 2 ++
 .../apache/inlong/manager/client/api/util/InlongGroupTransfer.java    | 4 ++++
 2 files changed, 6 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 388745684..3472b7141 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
@@ -71,6 +71,8 @@ public class InlongGroupImpl implements InlongGroup {
         if (newGroupInfo != null) {
             this.groupContext.setGroupInfo(groupInfo);
         } else {
+            BaseSortConf sortConf = groupInfo.getSortConf();
+            groupInfo = InlongGroupTransfer.createGroupInfo(groupInfo, sortConf);
             String groupId = managerClient.createGroup(groupInfo.genRequest());
             groupInfo.setInlongGroupId(groupId);
         }
diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
index 4efb42a6b..26a604e1f 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/util/InlongGroupTransfer.java
@@ -72,6 +72,10 @@ public class InlongGroupTransfer {
             originGroupInfo.getExtList().addAll(extInfos);
         }
 
+        if (sortConf == null) {
+            throw new IllegalArgumentException(
+                    String.format("sort config cannot be empty for group=", originGroupInfo.getInlongGroupId()));
+        }
         // set the sort config into ext list
         SortType sortType = sortConf.getType();
         List<InlongGroupExtInfo> sortExtInfos;