Status
Current state: Under Discussion
Discussion thread: here
JIRA: here
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Unlike key-value state stores, Kafka Streams currently does not provide a way to query the range of keys available in a windowed state store.
The only available alternative is to aggregate all the distinct keys into a single key for a given window, or to implement your own windowed state store.
Public Interfaces
This KIP would add the following method to the ReadOnlyWindowStore
interface
WindowStoreIterator<V> fetch(K from, K to, long timeFrom, long timeTo)
The time range would follow the existing ReadOnlyWindowStore.fetch(K key, long timeFrom, long timeTo)
behavior for the time range.
Key range behavior would be consistent with the existing ReadOnlyKeyValueStore.range(K from, K to)
behavior.
Proposed Changes
This KIP proposes to add the interface described above and implement range scan returning all the entries in the given key range that also match the given time interval.
Compatibility, Deprecation, and Migration Plan
- Users implementing their own windowed state stores would be affected by the interface changes.
Rejected Alternatives
None