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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]