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/07/27 04:06:44 UTC

[GitHub] [inlong] haibo-duan commented on a diff in pull request #5220: [INLONG-5212][Manager] Merge the Selector classes into their related Listeners

haibo-duan commented on code in PR #5220:
URL: https://github.com/apache/inlong/pull/5220#discussion_r930569071


##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/mq/CreatePulsarTopicTaskListener.java:
##########
@@ -57,6 +60,38 @@ public TaskEvent event() {
         return TaskEvent.COMPLETE;
     }
 
+    @Override
+    public boolean accept(WorkflowContext context) {
+        ProcessForm processForm = context.getProcessForm();
+        if (!(processForm instanceof StreamResourceProcessForm)) {
+            return false;
+        }
+        StreamResourceProcessForm streamResourceProcessForm = (StreamResourceProcessForm) processForm;
+        GroupOperateType operateType = streamResourceProcessForm.getGroupOperateType();
+        if (operateType != GroupOperateType.INIT) {
+            return false;
+        }
+
+        InlongGroupInfo groupInfo = streamResourceProcessForm.getGroupInfo();
+        MQType mqType = MQType.forType(groupInfo.getMqType());
+        String groupId = groupInfo.getInlongGroupId();
+        String streamId = streamResourceProcessForm.getStreamInfo().getInlongStreamId();
+        if (mqType == MQType.PULSAR || mqType == MQType.TDMQ_PULSAR) {
+            InlongPulsarInfo pulsarInfo = (InlongPulsarInfo) groupInfo;
+            boolean enable = InlongConstants.ENABLE_CREATE_RESOURCE.equals(pulsarInfo.getEnableCreateResource());
+            if (enable) {

Review Comment:
   There is no need to define the variable enable here.



-- 
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