You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2020/09/02 11:46:03 UTC

[GitHub] [beam] mxm commented on a change in pull request #12733: [BEAM-10760] Optimize state cleanup for global window in portable Flink runner

mxm commented on a change in pull request #12733:
URL: https://github.com/apache/beam/pull/12733#discussion_r481938984



##########
File path: runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/ExecutableStageDoFnOperator.java
##########
@@ -592,12 +593,35 @@ public long applyOutputWatermarkHold(long currentOutputWatermark, long potential
         return currentOutputWatermark;
       }
     } else {
+      // Check if the final watermark was triggered to perform state cleanup for global window
+      if (potentialOutputWatermark > BoundedWindow.TIMESTAMP_MAX_VALUE.getMillis()
+          && currentOutputWatermark <= BoundedWindow.TIMESTAMP_MAX_VALUE.getMillis()) {
+        cleanupGlobalWindowState();
+      }

Review comment:
       This logic should be moved to `DoFnOperator#emitWatermark`. It can then also be simplified.




----------------------------------------------------------------
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:
users@infra.apache.org