healchow commented on code in PR #4135:
URL: https://github.com/apache/incubator-inlong/pull/4135#discussion_r868891322


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/sink/StreamSinkServiceImpl.java:
##########
@@ -96,8 +98,14 @@ public Integer save(SinkRequest request, String operator) {
         // Make sure that there is no sink info with the current groupId and 
streamId
         String streamId = request.getInlongStreamId();
         String sinkType = request.getSinkType();
-        List<StreamSinkEntity> sinkExist = 
sinkMapper.selectByIdAndType(groupId, streamId, sinkType);
-        Preconditions.checkEmpty(sinkExist, 
ErrorCodeEnum.SINK_ALREADY_EXISTS.getMessage());
+        String sinkName = request.getSinkName();
+        List<StreamSinkEntity> sinkList = 
sinkMapper.selectByRelatedId(groupId, streamId);

Review Comment:
   Maybe we can add sinkName into the select params, to reduce the number of 
the returned sink list.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to