kafka icon indicating copy to clipboard operation
kafka copied to clipboard

KAFKA-7699: Anchored punctuation

Open hermanjakobsen opened this issue 6 months ago • 2 comments

This PR implements Processor API interfaces for using Anchored punctuation. As described in https://cwiki.apache.org/confluence/display/KAFKA/KIP-1146%3A+Anchored+punctuation, anchored punctuations allows the users of the PAPI to set both a start time and an interval for when the punctuations should be triggered. The changes have been based on all the places where org.apache.kafka.streams.processor.internals.ProcessorContext.schedule() is used.

The changes consist of introducing new interfaces as the punctuation time logic in the org.apache.kafka.streams.processor.internals.PunctuationSchedule already supports calculating a new punctuation time based on a start time and an interval.

The original schedule() implementations have been refactored into using the new schedule() implementation supporting the startTime parameter. For the original implementations, the startTime parameter has been sat to null, effectively using the "method overloading" programming technique.

hermanjakobsen avatar Jun 09 '25 17:06 hermanjakobsen

Would really appreciate input from @mjsax, @ableegoldman or @bbejeck as this is my first PR to the Kafka project :)

hermanjakobsen avatar Jun 09 '25 17:06 hermanjakobsen

Very good work!

andhusa avatar Jun 10 '25 09:06 andhusa

@hermanjakobsen build failure seems related

bbejeck avatar Nov 14 '25 17:11 bbejeck

@hermanjakobsen build failure seems related

I'm having a hard time seeing why :/ Running all the tests in StreamTaskTest.java locally works fine:

image

Also, this MR is not touching the StreamMetricsImpl class.

hermanjakobsen avatar Nov 14 '25 18:11 hermanjakobsen

I know what it is, a PR has been merged that changes StreamsMetricsImpl constructor to

                              final String clientId,
                              final String processId,
                              final String applicationId,
                              final Time time) {

But this PR has

                              final String clientId,
                              final String processId,
                              final Time time) {

Can I ask you to rebase this PR again? I think that will fix things

bbejeck avatar Nov 14 '25 19:11 bbejeck

Tried to do a rebase now

hermanjakobsen avatar Nov 14 '25 19:11 hermanjakobsen

OK I pulled down the PR and can confirm the error streams_task_test I think we just need to update line 3489 and we'll get clean build and get this merged

bbejeck avatar Nov 14 '25 21:11 bbejeck

Fixed the rebase mistake 😇

hermanjakobsen avatar Nov 15 '25 13:11 hermanjakobsen

Merged #19937 into trunk

bbejeck avatar Nov 17 '25 18:11 bbejeck

@hermanjakobsen can you do a follow-up PR against docs/upgrade.html in the Notable changes in 4.2.0 section for KIP-1146 and the changes?

bbejeck avatar Nov 17 '25 18:11 bbejeck