Versions Compared

Key

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

...

Code Block
languagejava
public class SlidingWindows {
    // New
    public static SlidingWindows ofTimeDifferenceWithNoGrace(final Duration timeDifference);

    // Existing: note, this starts with "with" and not "of" like the others, we could deprecate it to bring the API in alignment but it seems not worth the disruption to users to change one word
    public static SlidingWindows withTimeDifferenceAndGrace(final Duration timeDifference, final Duration afterWindowEnd);
}

Proposed Changes

The underlying principle here is that grace period is a fundamental concept in Kafka Streams, not an advanced feature which we only recommend for advanced users and which most applications can ignore. At the same time, sometimes a new user just wants to get a demo up and running without necessarily diving into every detail of a windowed operation. An ideal API is one in which the user is forced to at least acknowledge – for example by picking some auto-complete method in their IDE – that they are choosing one set of semantics over another.

Therefore, all All existing APIs which don't accept a grace period and apply a default grace period of 24 hours will be removed. These will be replaced with two new methods APIs: one which end ends in `WithNoGrace` and applies a grace period of 0, and one which as the name suggests will apply a grace period of 0takes the grace period as a required parameter. In constructing a windowed operation, users must choose between one of these two APIs and make a conscious decision whether to select a grace period or ignore that parameter for the time being.

Compatibility, Deprecation, and Migration Plan

...