Jess668 opened a new pull request, #22583: URL: https://github.com/apache/kafka/pull/22583
## Summary Proof-of-concept for [KIP-1356: Introduce IQv2 for headers-aware state stores](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1356), built on top of the KIP-1271 headers-aware store infrastructure. JIRA: [KAFKA-20682](https://issues.apache.org/jira/browse/KAFKA-20682). This PoC implements **only the first of the four proposed query types** — `TimestampedKeyWithHeadersQuery` (the headers-aware parallel of `TimestampedKeyQuery`) — end to end, to validate the approach. It is intentionally not fully polished. ## What's included - **New `@Evolving` query class** `org.apache.kafka.streams.query.TimestampedKeyWithHeadersQuery`, returning `ValueTimestampHeaders<V>` instead of `ValueAndTimestamp<V>`. - **Handler** in `MeteredTimestampedKeyValueStoreWithHeaders` that mirrors the existing `runTimestampedKeyQuery` (serialize key, forward a raw `KeyQuery` down the wrapper chain, deserialize the bytes) but keeps the full `ValueTimestampHeaders` instead of stripping the headers. - **Bottom-layer wiring**: `RocksDBTimestampedStoreWithHeaders.query()` now serves a raw `KeyQuery` via `StoreQueryUtils.handleBasicQueries`. KIP-1271 had hardwired this layer to `UNKNOWN_QUERY_TYPE`, which makes a forwarded query fail once the record cache is flushed (a cache miss falls through to this layer). The metered store still performs the header-aware deserialization; other query types remain unsupported. - **End-to-end integration test** `TimestampedKeyWithHeadersQueryIntegrationTest` (caching disabled, so every query provably reaches the RocksDB layer) asserting value/timestamp/headers round-trip, including empty-headers and tombstone cases, plus the unknown-query-type failure against a non-headers store. - Updated the two unit tests that asserted the old "`KeyQuery` → `UNKNOWN_QUERY_TYPE`" behavior on the headers store. ## Out of scope for this PoC - The other three query types: `TimestampedRangeWithHeadersQuery`, `WindowKeyWithHeadersQuery`, `WindowRangeWithHeadersQuery` (and the corresponding `RangeQuery` bottom-layer wiring). - `skipCache()` is accepted by the new query type but is currently a no-op — the flag is not propagated to the underlying cache (documented in code). ## Testing - New integration test passes; affected unit tests updated and passing. - `:streams:test` (full suite), `checkstyleMain`/`checkstyleTest` green. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
