Versions Compared

Key

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

Table of Contents

Status

Current state: Under Discussion Accepted

Discussion thread: here 

JIRA: here 

...

The stream module of Kafka has a window state store that stores the aggregated values for a key in a given time frame. The window store is implemented as an interface, this interface has a strange method named put(key, value), this method has does not have a timestamp as a parameter which is important to determine that to which window frame does the key belongs. In this method, the current record timestamp is used for determining the window frame(as specified in the description of the method), this constraint makes WindowStore error prone. It is also specified in the method description that method with a timestamp parameter should be used which already present in the interface which expects key, value, and start timestamp as well of the window to which the key belongs. Therefore by deprecating (and finally removing) the method putmethod put(key, value), we can prevent inconsistency.

...

Also, there are tests which are needed to be updated after removal deprecation of the specified method. Following  Following are the list of test classes which are needed to update.

...

Rejected Alternatives

As here we are proposing to remove to deprecate a method because the method does not satisfy the behavior behaviour of the interface, the alternative would be to:-

  • Update the method, so that the correct timestamp associated with the key can be accessed
    • To implement this an easy way is to directly use the method already present in the interface which accepts start timestamp of the window as the parameter insteadSince this API can be called by the user, updating the method can break the code. By this reason, this approach is not feasible.