Current state: "Under Discussion"
Discussion thread: [DISCUSS] KIP-439: Deprecate Interface WindowStoreIterator
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
The window and session store interfaces have confusing method names and return types:
- The `ReadOnlyWindowStore` interface has multiple methods to `fetch()` data. However, the return types are mixed up. Two methods return `WindowStoreIterator` while all others return `KeyValueIterator`.
- The `ReadOnlyWindowStore` interface has method `fetch()`, `fetchAll()`, and `all()` that all do range queries with different parameters.
- The `ReadOnlySessionStore` interface has `fetch()` method while the `SessionStore` interface has `findSession()` methods that all do range queries with different parameters
- The `WindStore#fetch(K, long)` and `SessionStore#fetchSession(k, long, long)` return a single value of a stored window or session but don't do a range query.
We should align the return types and method nodes of both interfaces to get a unified API.
Additionally, the provided metrics with name `fetch` is used for all above mentioned methods (ie, implicit roll-up) making it hard to reason about the metrics.
We propose to deprecate interface `WindowStoreIterator` and the following methods. Furthermore, new `range(...)` and `get()` methods are added to replace existing ones.
We propose to replace `WindowStoreIterator` with `KeyValueIterator` as return type for all range query methods. Additionally, the return type for window/session stores should be changed to `Windowed<K>` key type instead of returning only a `Long` that encoded the window-start timestamp. For this, the `WindowStoreIterator` interface and the corresponding `fetch()` methods are deprecated and new methods with new return types are added.
Furthermore, all methods returning an Iterator should have the same name (`range`), while method that don't return an Iterator should have a different name (`get`).
Additionally, we want to split up metrics to be able to track each method call independently. At the moment, there is a `fetch` metric that is used by all methods called `fetch()/fetchAll()/all()/findSession()` independent of their parameter list. We split the existing `fetch` metric into fine grained metrics per method overload.
Compatibility, Deprecation, and Migration Plan
Because we only deprecate interfaces/methods but don't change any other code this change is backward compatible. Calls to deprecated methods are redirected to new methods and the existing `fetch` metric is still recorded unmodified.