Skip to content

KStreams PAPI test for TimestampedWindowStoreWithHeaders - #4415

Open
Lucy Liu (lucliu1108) wants to merge 3 commits into
masterfrom
timestamped-windowed-store-header-test
Open

KStreams PAPI test for TimestampedWindowStoreWithHeaders#4415
Lucy Liu (lucliu1108) wants to merge 3 commits into
masterfrom
timestamped-windowed-store-header-test

Conversation

@lucliu1108

Copy link
Copy Markdown
Member

Summary

This PR adds:

  1. TimestampedWindowStoreWithHeadersIntegrationTest, which did PAPI test on timestampedWindowStoreWithHeaders, and validate store operations in the processor.

What

Checklist

Please answer the questions with Y, N or N/A if not applicable.

  • [ ] Contains customer facing changes? Including API/behavior changes
  • [ ] Is this change gated behind config(s)?
    • List the config(s) needed to be set to enable this change
  • [ ] Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required
  • [ ] Does this change require modifying existing system tests or adding new system tests?
    • If so, include tracking information for the system test changes
  • [ ] Must this be released together with other change(s), either in this repo or another one?
    • If so, please include the link(s) to the changes that must be released together

References

JIRA:

Test & Review

Open questions / Follow-ups

@lucliu1108
Lucy Liu (lucliu1108) requested a review from a team as a code owner July 9, 2026 17:37
Copilot AI review requested due to automatic review settings July 9, 2026 17:37
@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new Kafka Streams integration test class to validate TimestampedWindowStoreWithHeaders behavior when schema IDs are transported via record headers (PAPI), including both processor-driven store operations and IQv1 query access.

Changes:

  • Adds TimestampedWindowStoreWithHeadersIntegrationTest covering put/point fetch, range fetch variants, time-range fetchAll/backward fetchAll, and key-range fetch variants.
  • Adds IQv1 verification using a custom QueryableStoreType to query TimestampedWindowStoreWithHeaders and validate returned headers.
  • Adds additional scenarios for delete via tombstones, iterator behavior (all() + iterator methods), and restore-from-changelog header preservation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +90 to +92
private static final String INPUT_TOPIC = "events-input";
private static final String OUTPUT_TOPIC = "windowed-output";
private static final String STORE_NAME = "event-window-store";
Comment on lines +87 to +88
public class
TimestampedWindowStoreWithHeadersIntegrationTest extends ClusterTestHarness {
Comment on lines +715 to +726
List<ConsumerRecord<GenericRecord, byte[]>> changelogRecords =
consumeRecords(changelogTopic, "changelog-consumer", 12, ByteArrayDeserializer.class);

int tombstoneCount = 0;
for (ConsumerRecord<GenericRecord, byte[]> record : changelogRecords) {
if (record.value() == null) {
tombstoneCount++;
Header keySchemaIdHeader = record.headers().lastHeader(SchemaId.KEY_SCHEMA_ID_HEADER);
assertNotNull(keySchemaIdHeader,
"Tombstone record should have key schema ID header");
}
}
@sonarqube-confluent

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants