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/05/14 00:45:20 UTC

[GitHub] [beam] ihji commented on a change in pull request #11607: [BEAM-9430] Fixes the bounds of initial watermark set to estimators instead of raising an error

ihji commented on a change in pull request #11607:
URL: https://github.com/apache/beam/pull/11607#discussion_r424809435



##########
File path: sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/splittabledofn/WatermarkEstimators.java
##########
@@ -37,18 +37,23 @@
     private Instant lastReportedWatermark;
 
     public Manual(Instant watermark) {
+      validateWatermark(watermark);
       this.watermark = checkNotNull(watermark, "watermark must not be null.");
-      if (watermark.isBefore(GlobalWindow.TIMESTAMP_MIN_VALUE)
-          || watermark.isAfter(GlobalWindow.TIMESTAMP_MAX_VALUE)) {
+    }
+
+    private void validateWatermark(Instant watermark) {

Review comment:
       How about moving to parent scope and making static so we can share this method in all three estimators?




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