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 2022/09/20 15:18:52 UTC

[GitHub] [beam] damccorm commented on a diff in pull request #23302: [Java SDK core] emit watermark from PeriodicSequence (#23301)

damccorm commented on code in PR #23302:
URL: https://github.com/apache/beam/pull/23302#discussion_r975406751


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PeriodicSequence.java:
##########
@@ -178,9 +182,22 @@ public RestrictionTracker<OffsetRange, Long> newTracker(@Restriction OffsetRange
       return new OutputRangeTracker(restriction);
     }
 
+    @GetInitialWatermarkEstimatorState
+    public Instant getInitialWatermarkState() {
+      return BoundedWindow.TIMESTAMP_MIN_VALUE;
+    }
+
+    @NewWatermarkEstimator
+    public WatermarkEstimator<Instant> newWatermarkEstimator(
+        @WatermarkEstimatorState Instant state) {
+
+      return new WatermarkEstimators.Manual(state);

Review Comment:
   ```suggestion
         return new WatermarkEstimators.Manual(state);
   ```



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PeriodicSequence.java:
##########
@@ -178,9 +182,22 @@ public RestrictionTracker<OffsetRange, Long> newTracker(@Restriction OffsetRange
       return new OutputRangeTracker(restriction);
     }
 
+    @GetInitialWatermarkEstimatorState

Review Comment:
   Non-blocking for this PR, but I noticed above that the restriction is always Bounded - should we set it to unbounded if the endTimestamp is omitted (set to `BoundedWindow.TIMESTAMP_MAX_VALUE`)?



##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/PeriodicSequence.java:
##########
@@ -178,9 +182,22 @@ public RestrictionTracker<OffsetRange, Long> newTracker(@Restriction OffsetRange
       return new OutputRangeTracker(restriction);
     }
 
+    @GetInitialWatermarkEstimatorState
+    public Instant getInitialWatermarkState() {
+      return BoundedWindow.TIMESTAMP_MIN_VALUE;

Review Comment:
   Should we use the restriction's minimum value here? (or maybe slightly less than that to allow the first element to be emitted)



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