dpcollins-google commented on code in PR #23861:
URL: https://github.com/apache/beam/pull/23861#discussion_r1008952752


##########
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:
   Tried to do this- then I realized that its infeasible, because the two 
parameters have the same type. Closing as infeasible since you couldn't form 
the overload set.



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