[ 
https://issues.apache.org/jira/browse/KAFKA-6323?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16295406#comment-16295406
 ] 

Matthias J. Sax commented on KAFKA-6323:
----------------------------------------

It's a fair question. I personally like code that is as predictable as 
possible, thus, I tend to say we should align schedules to fixed intervals (for 
both, system time and stream time). Thus, each time we need to "anchor" the 
punctuation because we register the first schedule or missed a schedule, we fix 
the schedule time to align. Ie., if one registers a schedule interval X, we 
should align to the {{floor(currentTimestamp + interval)}} where {{floor}} 
computes  {{max(n * X) <= currentTimestamp + interval}}. This is especially 
valuable for "stream-time" punctuations IMHO. Note, we also align windows in a 
similar way.

Just my two cents. \cc [~damianguy] [~bbejeck] [~guozhang] 

> punctuate with WALL_CLOCK_TIME triggered immediately
> ----------------------------------------------------
>
>                 Key: KAFKA-6323
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6323
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 1.0.0
>            Reporter: Frederic Arno
>            Assignee: Frederic Arno
>             Fix For: 1.1.0, 1.0.1
>
>
> When working on a custom Processor from which I am scheduling a punctuation 
> using WALL_CLOCK_TIME. I've noticed that whatever the punctuation interval I 
> set, a call to my Punctuator is always triggered immediately.
> Having a quick look at kafka-streams' code, I could find that all 
> PunctuationSchedule's timestamps are matched against the current time in 
> order to decide whether or not to trigger the punctuator 
> (org.apache.kafka.streams.processor.internals.PunctuationQueue#mayPunctuate). 
> However, I've only seen code that initializes PunctuationSchedule's timestamp 
> to 0, which I guess is what is causing an immediate punctuation.
> At least when using WALL_CLOCK_TIME, shouldn't the PunctuationSchedule's 
> timestamp be initialized to current time + interval?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to