You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/08/31 16:42:06 UTC

[GitHub] [inlong] ciscozhou opened a new pull request, #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

ciscozhou opened a new pull request, #5758:
URL: https://github.com/apache/inlong/pull/5758

   ### Prepare a Pull Request
   
   - Fixes #5611
   
   ### Motivation
   
   Set the sink status after updating the sink info.
   
   ### Modifications
   
   After updating the stream sink info, if the status of inlong stream was CONFIG_SUCCESSFUL or CONFIG_FAILED, change the sink status to CONFIG_ING, otherwise not change the sink status.
   
   1. If the stream status was CONFIG_SUCCESSFUL, no matter what status of the sink, all changing to CONFIG_ING, and start the CREATE_STREAM_PROCESS, after the process will change the sink status to CONFIG_SUCCESSFUL or CONFIG_FAILED.
   
   2. If the stream status was CONFIG_FAILED, it means there are some errors occurred, the user must fix it first, and in this situation, sink status also need to be CONFIG_ING, it tells the user that the sink info was updated success, and begin to configuring. Only after the stream error was fixed, the sink status will change to CONFIG_SUCCESSFUL or CONFIG_FAILED.
   
   ### Verifying this change
   
   - [x] This change is a trivial rework/code cleanup without any test coverage.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] dockerzhang merged pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
dockerzhang merged PR #5758:
URL: https://github.com/apache/inlong/pull/5758


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5758:
URL: https://github.com/apache/inlong/pull/5758#discussion_r960175333


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -224,23 +231,27 @@ public Boolean update(SinkRequest request, String operator) {
             }
         }
         List<SinkField> fields = request.getSinkFieldList();
-        // Remove id in sinkField when save
+        // Remove id in sinkField before saving or updating
         if (CollectionUtils.isNotEmpty(fields)) {
             fields.forEach(sinkField -> sinkField.setId(null));

Review Comment:
   Can we just remove the id field to be inserted in the sql stmt ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5758:
URL: https://github.com/apache/inlong/pull/5758#discussion_r960177628


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -224,23 +231,27 @@ public Boolean update(SinkRequest request, String operator) {
             }
         }
         List<SinkField> fields = request.getSinkFieldList();
-        // Remove id in sinkField when save
+        // Remove id in sinkField before saving or updating
         if (CollectionUtils.isNotEmpty(fields)) {
             fields.forEach(sinkField -> sinkField.setId(null));
         }
 
+        SinkStatus nextStatus = null;
+        boolean streamSuccess = StreamStatus.CONFIG_SUCCESSFUL.getCode().equals(streamEntity.getStatus());
+        if (streamSuccess || StreamStatus.CONFIG_FAILED.getCode().equals(streamEntity.getStatus())) {
+            nextStatus = SinkStatus.CONFIG_ING;
+        }
         StreamSinkOperator sinkOperator = operatorFactory.getInstance(request.getSinkType());
-        sinkOperator.updateOpt(request, operator);
+        sinkOperator.updateOpt(request, nextStatus, operator);
 
-        // The inlong group status is [Configuration successful], then asynchronously initiate
-        // the [Single inlong stream resource creation] workflow
-        if (GroupStatus.CONFIG_SUCCESSFUL.getCode().equals(groupEntity.getStatus())) {
+        // If the stream is [CONFIG_SUCCESSFUL], then asynchronously start the [CREATE_STREAM_RESOURCE] process

Review Comment:
   In the comment it still says _asynchronously_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5758:
URL: https://github.com/apache/inlong/pull/5758#discussion_r960177628


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -224,23 +231,27 @@ public Boolean update(SinkRequest request, String operator) {
             }
         }
         List<SinkField> fields = request.getSinkFieldList();
-        // Remove id in sinkField when save
+        // Remove id in sinkField before saving or updating
         if (CollectionUtils.isNotEmpty(fields)) {
             fields.forEach(sinkField -> sinkField.setId(null));
         }
 
+        SinkStatus nextStatus = null;
+        boolean streamSuccess = StreamStatus.CONFIG_SUCCESSFUL.getCode().equals(streamEntity.getStatus());
+        if (streamSuccess || StreamStatus.CONFIG_FAILED.getCode().equals(streamEntity.getStatus())) {
+            nextStatus = SinkStatus.CONFIG_ING;
+        }
         StreamSinkOperator sinkOperator = operatorFactory.getInstance(request.getSinkType());
-        sinkOperator.updateOpt(request, operator);
+        sinkOperator.updateOpt(request, nextStatus, operator);
 
-        // The inlong group status is [Configuration successful], then asynchronously initiate
-        // the [Single inlong stream resource creation] workflow
-        if (GroupStatus.CONFIG_SUCCESSFUL.getCode().equals(groupEntity.getStatus())) {
+        // If the stream is [CONFIG_SUCCESSFUL], then asynchronously start the [CREATE_STREAM_RESOURCE] process

Review Comment:
   In the comment it still says asynchronously



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5758:
URL: https://github.com/apache/inlong/pull/5758#discussion_r960175333


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -224,23 +231,27 @@ public Boolean update(SinkRequest request, String operator) {
             }
         }
         List<SinkField> fields = request.getSinkFieldList();
-        // Remove id in sinkField when save
+        // Remove id in sinkField before saving or updating
         if (CollectionUtils.isNotEmpty(fields)) {
             fields.forEach(sinkField -> sinkField.setId(null));

Review Comment:
   Can we just remove the field id to be inserted in the sql stmt ?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [inlong] woofyzhao commented on a diff in pull request #5758: [INLONG-5611][Manager] Set the sink status after updating the sink info

Posted by GitBox <gi...@apache.org>.
woofyzhao commented on code in PR #5758:
URL: https://github.com/apache/inlong/pull/5758#discussion_r960177628


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -224,23 +231,27 @@ public Boolean update(SinkRequest request, String operator) {
             }
         }
         List<SinkField> fields = request.getSinkFieldList();
-        // Remove id in sinkField when save
+        // Remove id in sinkField before saving or updating
         if (CollectionUtils.isNotEmpty(fields)) {
             fields.forEach(sinkField -> sinkField.setId(null));
         }
 
+        SinkStatus nextStatus = null;
+        boolean streamSuccess = StreamStatus.CONFIG_SUCCESSFUL.getCode().equals(streamEntity.getStatus());
+        if (streamSuccess || StreamStatus.CONFIG_FAILED.getCode().equals(streamEntity.getStatus())) {
+            nextStatus = SinkStatus.CONFIG_ING;
+        }
         StreamSinkOperator sinkOperator = operatorFactory.getInstance(request.getSinkType());
-        sinkOperator.updateOpt(request, operator);
+        sinkOperator.updateOpt(request, nextStatus, operator);
 
-        // The inlong group status is [Configuration successful], then asynchronously initiate
-        // the [Single inlong stream resource creation] workflow
-        if (GroupStatus.CONFIG_SUCCESSFUL.getCode().equals(groupEntity.getStatus())) {
+        // If the stream is [CONFIG_SUCCESSFUL], then asynchronously start the [CREATE_STREAM_RESOURCE] process

Review Comment:
   In the comment it still says _asynchronously_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org