You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "ahmedabu98 (via GitHub)" <gi...@apache.org> on 2023/08/16 19:53:15 UTC

[GitHub] [beam] ahmedabu98 commented on a diff in pull request #27998: Use Periodic Impulse for BQ SchemaUpdate tests

ahmedabu98 commented on code in PR #27998:
URL: https://github.com/apache/beam/pull/27998#discussion_r1296362509


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PeriodicSequence.java:
##########
@@ -223,11 +233,17 @@ public ProcessContinuation processElement(
           estimator.setWatermark(output);
           nextOutput = nextOutput + interval;
         }
+        if (!srcElement.catchUpToNow) {
+          break;
+        }
       }
 
       ProcessContinuation continuation = ProcessContinuation.stop();
       if (claimSuccess) {
-        Duration offset = new Duration(Instant.now(), Instant.ofEpochMilli(nextOutput));
+        Duration offset =
+            srcElement.catchUpToNow
+                ? new Duration(Instant.now(), Instant.ofEpochMilli(nextOutput))
+                : new Duration(interval);

Review Comment:
   >If catchUpToNow=False, then the emitted interval can be minutes old than now, is that true? 
   
   That's right, this would allow having a start time of `new Instant(0)` and still respecting the fire interval.
   
   > Is it possible to keep the emitted timestamp nearly now?
   
   I think if a user needs this, they can just not set the flag. The current behavior does just that.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org