Status
Current state: "Under Discussion"
Discussion thread: TBD
JIRA: KAFKA-4304
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Taken from related issue:
Currently, when querying state store, it is not clear when the key was updated last. The ides of this JIRA is to make the latest update timestamp for each key-value-pair of the state store accessible.
For example, this might be useful to
- check if a value was update but did not changed (just compare the update TS)
- if you want to consider only recently updated keys
Public Interfaces
ReadOnlyKeyValueStore
long getKeyTs(K key); KeyContext<K, V> get(K key); // we add this interface for use-cases where user will query for key and query for key timestamp again. To avoid double querying we overload get() method
Proposed Changes
We propose add a new interface KeyContext
which will keep info about key. We can include more methods inside this context as well.
public interface KeyContext<K, V> { K key(); V value(); long keyTs(); }
Compatibility, Deprecation, and Migration Plan
Not yet
Rejected Alternatives
Not yet