StefanRRichter commented on a change in pull request #8409: [FLINK-12478]
Decompose monolithic run-loops in StreamTask implementa…
URL: https://github.com/apache/flink/pull/8409#discussion_r284576042
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -222,12 +222,24 @@ protected StreamTask(
protected abstract void init() throws Exception;
- protected abstract void run() throws Exception;
-
protected abstract void cleanup() throws Exception;
protected abstract void cancelTask() throws Exception;
+ /**
+ * This method implements the default action of the task (e.g.
processing one event from the input). Implementations
+ * should (in general) be non-blocking.
+ *
+ * @return <code>true</code> if there is more work to perform as
default action for this task and <code>false</code>
+ * if the task is ready to finish.
+ * @throws Exception on any problems in the action.
+ */
+ protected abstract boolean performDefaultAction() throws Exception;
Review comment:
I would disagree with that because the context without the mailbox makes no
sense and without the boolean return value and no mailbox this would not work
(there may be ways to make it work, but those would then also have to be
changed in a later commit, so no win). I think it is ok two have two commits
that apply the change incrementally and can stand by themselves.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services