Aitozi commented on a change in pull request #8431: [FLINK-12480] Introduce
mailbox to StreamTask main-loop
URL: https://github.com/apache/flink/pull/8431#discussion_r283674851
##########
File path:
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java
##########
@@ -1280,4 +1320,40 @@ public void
tryHandleCheckpointException(CheckpointMetaData checkpointMetaData,
output.setMetricGroup(environment.getMetricGroup().getIOMetricGroup());
return output;
}
+
+ /**
+ * The action context is passed as parameter into the default action
method and holds control methods for feedback
+ * of from the default action to the mailbox.
+ */
+ public final class ActionContext {
+
+ private final Runnable actionUnavailableLetter =
ThrowingRunnable.unchecked(mailbox::waitUntilHasMail);
+
+ /**
+ * This method must be called to end the stream task when all
actions for the tasks have been performed.
+ */
+ public void allActionsCompleted() {
+ mailbox.shutDown(POISON_LETTER);
+ }
+
+ /**
+ * Calling this method signals that the mailbox-tread should
continue invoking the default action, e.g. because
Review comment:
mailbox-thread?
----------------------------------------------------------------
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