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/08/12 05:36:36 UTC

[inlong] branch master updated: [INLONG-5517][Manager] Fix not write back version when updating operate in manager client (#5518)

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/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 88f04df6c [INLONG-5517][Manager] Fix not write back version when updating operate in manager client (#5518)
88f04df6c is described below

commit 88f04df6c04b4df11574917ef9a7cc0c129a6ad6
Author: Xin Gong <ge...@gmail.com>
AuthorDate: Fri Aug 12 13:36:32 2022 +0800

    [INLONG-5517][Manager] Fix not write back version when updating operate in manager client (#5518)
---
 .../apache/inlong/manager/client/api/impl/InlongStreamImpl.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongStreamImpl.java b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongStreamImpl.java
index d2ededf23..bcd851a25 100644
--- a/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongStreamImpl.java
+++ b/inlong-manager/manager-client/src/main/java/org/apache/inlong/manager/client/api/impl/InlongStreamImpl.java
@@ -33,6 +33,8 @@ import org.apache.inlong.manager.client.api.inner.client.StreamSourceClient;
 import org.apache.inlong.manager.client.api.inner.client.StreamTransformClient;
 import org.apache.inlong.manager.client.api.util.ClientUtils;
 import org.apache.inlong.manager.client.api.util.StreamTransformTransfer;
+import org.apache.inlong.manager.common.util.JsonUtils;
+import org.apache.inlong.manager.common.util.Preconditions;
 import org.apache.inlong.manager.pojo.sink.StreamSink;
 import org.apache.inlong.manager.pojo.source.StreamSource;
 import org.apache.inlong.manager.pojo.stream.InlongStreamInfo;
@@ -42,8 +44,6 @@ import org.apache.inlong.manager.pojo.stream.StreamPipeline;
 import org.apache.inlong.manager.pojo.stream.StreamTransform;
 import org.apache.inlong.manager.pojo.transform.TransformRequest;
 import org.apache.inlong.manager.pojo.transform.TransformResponse;
-import org.apache.inlong.manager.common.util.JsonUtils;
-import org.apache.inlong.manager.common.util.Preconditions;
 
 import java.util.List;
 import java.util.Map;
@@ -343,6 +343,7 @@ public class InlongStreamImpl implements InlongStream {
                 TransformRequest transformRequest = StreamTransformTransfer.createTransformRequest(newTransform,
                         streamInfo);
                 transformRequest.setId(id);
+                transformRequest.setVersion(transformResponse.getVersion());
                 Pair<Boolean, String> updateState = transformClient.updateTransform(transformRequest);
                 if (!updateState.getKey()) {
                     throw new RuntimeException(String.format("Update transform=%s failed with err=%s", transformRequest,
@@ -379,6 +380,7 @@ public class InlongStreamImpl implements InlongStream {
                 streamSource.setId(id);
                 streamSource.setInlongGroupId(streamInfo.getInlongGroupId());
                 streamSource.setInlongStreamId(streamInfo.getInlongStreamId());
+                streamSource.setVersion(source.getVersion());
                 Pair<Boolean, String> updateState = sourceClient.updateSource(streamSource.genSourceRequest());
                 if (!updateState.getKey()) {
                     throw new RuntimeException(String.format("Update source=%s failed with err=%s", streamSource,
@@ -416,6 +418,7 @@ public class InlongStreamImpl implements InlongStream {
                 streamSink.setId(id);
                 streamSink.setInlongGroupId(streamInfo.getInlongGroupId());
                 streamSink.setInlongStreamId(streamInfo.getInlongStreamId());
+                streamSink.setVersion(sink.getVersion());
                 Pair<Boolean, String> updateState = sinkClient.updateSink(streamSink.genSinkRequest());
                 if (!updateState.getKey()) {
                     throw new RuntimeException(String.format("Update sink=%s failed with err=%s", streamSink,