je-ik commented on code in PR #30141:
URL: https://github.com/apache/beam/pull/30141#discussion_r1469293902


##########
runners/flink/src/main/java/org/apache/beam/runners/flink/translation/wrappers/streaming/io/source/unbounded/FlinkUnboundedSourceReader.java:
##########
@@ -103,22 +104,23 @@ public void start() {
     createPendingBytesGauge(context);
     Long watermarkInterval =
         
pipelineOptions.as(FlinkPipelineOptions.class).getAutoWatermarkInterval();
-    if (watermarkInterval != null) {
-      scheduleTaskAtFixedRate(
-          () -> {
-            // Set the watermark emission flag first.
-            shouldEmitWatermark = true;
-            // Wake up the main thread if necessary.
-            CompletableFuture<Void> f = dataAvailableFutureRef.get();
-            if (f != DUMMY_FUTURE) {
-              f.complete(null);
-            }
-          },
-          watermarkInterval,
-          watermarkInterval);
-    } else {
-      LOG.warn("AutoWatermarkInterval is not set, watermarks won't be 
emitted.");
+    if (watermarkInterval == null) {
+      watermarkInterval = DEFAULT_WATERMARK_EMIT_INTERVAL_MS;

Review Comment:
   Can we derive this from `getMaxBundleTimeMillis()` from 
`FlinkPipelineOptions`? It might be maxBundleTimeMillis / 5 (to get the 200 ms 
default) or so.



-- 
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