AHeise commented on a change in pull request #10435: [FLINK-13955][runtime]
migrate ContinuousFileReaderOperator to the mailbox execution model
URL: https://github.com/apache/flink/pull/10435#discussion_r370043710
##########
File path:
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/ContinuousFileProcessingRescalingTest.java
##########
@@ -261,6 +280,22 @@ public void awaitEverythingProcessed() throws Exception {
getFormat().awaitFirstChunkProcessed();
getFormat().resume();
getFormat().awaitLastProcessed();
+ sendTask(getHarness().getTaskMailbox(), () ->
getHarness().close());
+ }
+
+ private static void sendTask(TaskMailbox mailbox,
ThrowingRunnable<?> task) throws Exception {
+ CompletableFuture<?> f = new CompletableFuture<>();
+ new
MailboxProcessor(MailboxDefaultAction.Controller::suspendDefaultAction,
mailbox, StreamTaskActionExecutor.IMMEDIATE)
+ .getMainMailboxExecutor()
+ .execute(() -> {
+ try {
+ task.run();
+ f.complete(null);
+ } catch (Throwable t) {
+
f.completeExceptionally(t);
+ }
+ }, "");
Review comment:
That's essentially the same as `mailbox.put(new Mail(<the lambda>, 0, ""));`
----------------------------------------------------------------
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