Zakelly commented on code in PR #25773:
URL: https://github.com/apache/flink/pull/25773#discussion_r1877548425


##########
flink-runtime/src/main/java/org/apache/flink/streaming/api/operators/InternalTimerServiceAsyncImpl.java:
##########
@@ -125,13 +137,14 @@ protected void foreachTimer(
                 "Batch operation is not supported when using async state.");
     }
 
-    private void maintainContextAndProcess(
+    private StateFuture<Void> maintainContextAndProcess(
             InternalTimer<K, N> timer, ThrowingRunnable<Exception> runnable) {
         RecordContext<K> recordCtx = 
asyncExecutionController.buildContext(null, timer.getKey());

Review Comment:
   Apart from current topic: How about make timer as the record and invoke 
`buildContext`?



##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/operators/AbstractAsyncStateStreamOperatorV2.java:
##########
@@ -260,6 +262,15 @@ public void processWatermark(Watermark mark) throws 
Exception {
         asyncExecutionController.processNonRecord(() -> 
super.processWatermark(mark));
     }
 
+    protected void emitWatermarkDirectly(Watermark mark) throws Exception {
+        if (timeServiceManager != null) {
+            CompletableFuture<Void> future = 
timeServiceManager.advanceWatermark(mark);
+            future.thenAccept(v -> output.emitWatermark(mark));

Review Comment:
   I think we should also consider `EpochManager.ParallelMode` here. If serial, 
should wait & drain here.



##########
flink-runtime/src/main/java/org/apache/flink/streaming/api/operators/InternalTimeServiceManagerImpl.java:
##########
@@ -238,10 +239,14 @@ KeyGroupedInternalPriorityQueue<TimerHeapInternalTimer<K, 
N>> createTimerPriorit
     }
 
     @Override
-    public void advanceWatermark(Watermark watermark) throws Exception {
+    public CompletableFuture<Void> advanceWatermark(Watermark watermark) 
throws Exception {
+        CompletableFuture<Void>[] futures = new 
CompletableFuture[timerServices.size()];

Review Comment:
   ```suggestion
           CompletableFuture<?>[] futures = new 
CompletableFuture[timerServices.size()];
   ```
   to avoid warning



##########
flink-runtime/src/main/java/org/apache/flink/runtime/asyncprocessing/operators/AbstractAsyncStateStreamOperator.java:
##########
@@ -333,6 +335,15 @@ public void processWatermark(Watermark mark) throws 
Exception {
         asyncExecutionController.processNonRecord(() -> 
super.processWatermark(mark));
     }
 
+    protected void emitWatermarkDirectly(Watermark mark) throws Exception {

Review Comment:
   How about rewriting `processWatermark` in 
`AbstractAsyncStateStreamOperator.java` instead of exposing the 
`emitWatermarkDirectly` ? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to