[ https://issues.apache.org/jira/browse/KAFKA-10871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17253173#comment-17253173 ]
Matthias J. Sax commented on KAFKA-10871: ----------------------------------------- I don't think this is a bug, but rather a performance optimization: We pass in the `wallClockTime` parameter, to avoid calling `Time.milliseconds()` (that translates to `System.currentTimeMillis()`) too often, because getting the current time is a somewhat expensive call to make. The caller, ie, the TaskManager calls `Time.milliseconds()` right before it calls `process()` and thus we can save one expensive call to get the time by passing the the wallClockTime. > StreamTask shouldn't take WallClockTime as input parameter in process method > ---------------------------------------------------------------------------- > > Key: KAFKA-10871 > URL: https://issues.apache.org/jira/browse/KAFKA-10871 > Project: Kafka > Issue Type: Bug > Components: streams > Affects Versions: 2.7.0 > Reporter: Rohit Deshpande > Assignee: Rohit Deshpande > Priority: Major > Labels: newbie > > While working on https://issues.apache.org/jira/browse/KAFKA-10062 I realized > process method in StreamTask is taking > wallClockTime as input parameter which is redundant as StreamTask already > contains > time(https://github.com/apache/kafka/blob/2.5.0/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java#L75) > field which represents wallClockTime. > In process method > (https://github.com/apache/kafka/blob/2.7/streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamTask.java#L664), > wallClockTime can be passed from StreamTask's time field itself. > This method was changed as part of pr: > https://github.com/apache/kafka/pull/7997. > As part of https://issues.apache.org/jira/browse/KAFKA-10062, I believe > wallClockTime need not be stored in > ProcessorContext(https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/processor/internals/AbstractProcessorContext.java#L48) > but should be fetched from StreamTask's time field. Reference pr: > https://github.com/apache/kafka/pull/9744 -- This message was sent by Atlassian Jira (v8.3.4#803005)