johnjcasey commented on code in PR #23861:
URL: https://github.com/apache/beam/pull/23861#discussion_r1007107430


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/transforms/WithTimestamps.java:
##########
@@ -68,58 +70,109 @@
    * }</pre>
    */
   public static <T> WithTimestamps<T> of(SerializableFunction<T, Instant> fn) {
-    return new WithTimestamps<>(fn, Duration.ZERO);
+    return new WithTimestamps<>(fn, null, null);
   }
 
   ///////////////////////////////////////////////////////////////////
 
   private final SerializableFunction<T, Instant> fn;
-  private final Duration allowedTimestampSkew;
+  // If allowedTimestampSkew is not null, use the deprecated behavior which 
emits data as late.
+  private final @Nullable Duration allowedTimestampSkew;
+  // If watermarkDelay is not null, emit data within the watermark delay bound 
as on time.
+  private final @Nullable Duration watermarkDelay;
 
-  private WithTimestamps(SerializableFunction<T, Instant> fn, Duration 
allowedTimestampSkew) {
+  private WithTimestamps(
+      SerializableFunction<T, Instant> fn,
+      @Nullable Duration allowedTimestampSkew,
+      @Nullable Duration watermarkDelay) {
+    checkArgument(
+        allowedTimestampSkew == null || watermarkDelay == null, "Both delays 
cannot be non-null.");

Review Comment:
   I suppose, but it is strange to have a method where a parameter must be null



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