Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The grace period is a parameter of windowed operations such as Window or Session aggregates, or stream-stream joins. This config determines how long after a window closes ends any new data will still be processed. Records coming in after the grace period has elapsed will be dropped from those windows.

...

All the classes extending from Windows will be aligned with the new approach to grace period. Two new static constructors will be added, one which accepts a grace period and one which indicates to use no grace period and not handle out-of-order data close the
window immediately when the window ends.

Code Block
languagejava
public class TimeWindows {

    @Deprecated
    public static TimeWindows of(Duration size);

    @Deprecated
    public TimeWindows grace(final Duration afterWindowEnd);
    
    // New
    public static TimeWindows ofSizeWithNoGrace(final Duration size);

    // New
    public static TimeWindows ofSizeAndGrace(final Duration size, final Duration afterWindowEnd);

}

...

Users who currently rely on any of the deprecated methods will need to migrate to one of the two new APIs, and make a conscious decision to skip the grace period and drop out-of-order recordsand close a window immediately, apply the old default of 24 hours, or choose a new grace period entirely.

...