izzyacademy commented on a change in pull request #10740:
URL: https://github.com/apache/kafka/pull/10740#discussion_r637015813



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/kstream/JoinWindows.java
##########
@@ -168,6 +172,50 @@ public JoinWindows grace(final Duration afterWindowEnd) 
throws IllegalArgumentEx
         return new JoinWindows(beforeMs, afterMs, afterWindowEndMs);
     }
 
+
+    /**
+     * Specifies that records of the same key are joinable if their timestamps 
are within {@code timeDifference},
+     * i.e., the timestamp of a record from the secondary stream is max {@code 
timeDifference} earlier or later than
+     * the timestamp of the record from the primary stream.
+     *
+     * @param timeDifference join window interval
+     * @throws IllegalArgumentException if {@code timeDifference} is negative 
or can't be represented as {@code long milliseconds}
+     * @since 3.0
+     */
+    public static JoinWindows ofTimeDifferenceWithNoGrace(final Duration 
timeDifference) {
+        return ofTimeDifferenceAndGrace(timeDifference, 
ofMillis(DEFAULT_GRACE_PERIOD_MS));
+    }
+
+    /**
+     * Reject out-of-order events that are delayed more than {@code 
afterWindowEnd}
+     * after the end of its window.
+     * <p>
+     * Delay is defined as (stream_time - record_timestamp).
+     *
+     * @param timeDifference join window interval
+     * @param afterWindowEnd The grace period to admit out-of-order events to 
a window.
+     * @return this updated builder
+     * @throws IllegalArgumentException if the {@code afterWindowEnd} is 
negative of can't be represented as {@code long milliseconds}
+     * @since 3.0
+     */
+    public static JoinWindows ofTimeDifferenceAndGrace(final Duration 
timeDifference, final Duration afterWindowEnd) {

Review comment:
       @ableegoldman that would be addressed in the next submission




-- 
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:
us...@infra.apache.org


Reply via email to