You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status

Current state"Under Discussion"

Discussion thread: TODO

JIRA Unable to render Jira issues macro, execution error.

Released: 2.3

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).

Motivation

The `WindowStore` interface has multiple methods to fetch() data. However, the return types are mixed up. Two methods return `WindowStoreIterator` while all others return `KeyValueIterator`. We should align the return types and replace `WindowStoreIterator` with `KeyValueIterator`.

Public Interfaces

We propose to deprecate interface `WindowStoreIterator`.

package org.apache.kafka.streams.state;


@Deprecate
public interface WindowStoreIterator<V> extends KeyValueIterator<Long, V>, Closeable;

Proposed Changes

We suggest to replace `WindowStoreIterator` with `KeyValueIterator`, however, we cannot change the return type of `WindowStore#fetch(K key, long timeFrom, long timeTo)` or `WindowStore#fetch(K key, Instant timeFrom, Instant timeTo)` right away because this would break backward compatibility. Instead, we only deprecate the interface `WindowStoreIterator`. This indicates to users, that they need to rewrite their code and to not use `WindowStoreIterator` any longer. We document this in all related JavaDocs to educate users that they should use `KeyValueIterator` instead.

In a future release, we can actually remove `WindowStoreIterator` and replace the return type to `KeyValueIterator`. At this point, all user code should be rewritten already such the return type change is safe.

Compatibility, Deprecation, and Migration Plan

Because we only deprecate an interface but not change any other code this change is backward compatible. In a future release, when the interface is actually removed and we change the return type, it is after the deprecation period and thus user code should be rewritten already.

Test Plan

N/A

Rejected Alternatives

N/A

  • No labels