fuweng11 commented on code in PR #9029:
URL: https://github.com/apache/inlong/pull/9029#discussion_r1349840308
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/cls/ClsResourceOperator.java:
##########
@@ -113,6 +120,31 @@ private void createTopicID(SinkInfo sinkInfo) {
}
}
+ private String getTopicID(SinkInfo sinkInfo, ClsDataNodeDTO clsDataNode,
ClsSinkDTO clsSinkDTO)
+ throws TencentCloudSDKException {
+ String topicID = describeTopicIDByTopicName(sinkInfo, clsDataNode);
+ if (Strings.isEmpty(topicID)) {
+ // if topic don't exist,create topic in cls
+ topicID = createTopicReturnTopicId(clsDataNode, clsSinkDTO);
+ }
+ return topicID;
+ }
+
+ private String createTopicReturnTopicId(ClsDataNodeDTO clsDataNode,
ClsSinkDTO clsSinkDTO)
+ throws TencentCloudSDKException {
+ ClsClient client = getClsClient(clsDataNode);
+ CreateTopicRequest req = getCreateTopicRequest(clsDataNode,
clsSinkDTO);
+ CreateTopicResponse resp = client.CreateTopic(req);
+ LOG.info("create cls topic {} success ,topicId {}",
clsSinkDTO.getTopicName(), resp.getTopicId());
Review Comment:
create cls topic success for topicName = {}, topicId = {}
--
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]