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/26 12:54:57 UTC

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

healchow commented on code in PR #5220:
URL: https://github.com/apache/inlong/pull/5220#discussion_r929928425


##########
inlong-manager/manager-plugins/src/main/java/org/apache/inlong/manager/plugin/listener/RestartStreamListener.java:
##########
@@ -56,6 +57,29 @@ public TaskEvent event() {
         return TaskEvent.COMPLETE;
     }
 
+    @Override
+    public boolean accept(WorkflowContext workflowContext) {
+        ProcessForm processForm = workflowContext.getProcessForm();
+        String groupId = processForm.getInlongGroupId();
+        if (!(processForm instanceof StreamResourceProcessForm)) {
+            log.info("not add restartStream listener, as the form was not StreamResourceProcessForm for groupId [{}]",
+                    groupId);
+            return false;
+        }
+
+        StreamResourceProcessForm streamProcessForm = (StreamResourceProcessForm) processForm;
+        String streamId = streamProcessForm.getStreamInfo().getInlongStreamId();
+        boolean flag = streamProcessForm.getGroupOperateType() == GroupOperateType.RESTART;
+        if (!flag) {

Review Comment:
   Good idea.



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