mjsax commented on code in PR #12037:
URL: https://github.com/apache/kafka/pull/12037#discussion_r849979498
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamSlidingWindowAggregate.java:
##########
@@ -81,23 +100,54 @@ private class KStreamSlidingWindowAggregateProcessor
extends ContextualProcessor
private TimestampedWindowStore<KIn, VAgg> windowStore;
private TimestampedTupleForwarder<Windowed<KIn>, VAgg> tupleForwarder;
private Sensor droppedRecordsSensor;
+ private Sensor emittedRecordsSensor;
+ private Sensor emitFinalLatencySensor;
private long observedStreamTime = ConsumerRecord.NO_TIMESTAMP;
+ private long lastEmitCloseTime = ConsumerRecord.NO_TIMESTAMP;
private Boolean reverseIteratorPossible = null;
+ private InternalProcessorContext<Windowed<KIn>, Change<VAgg>>
internalProcessorContext;
+ private final TimeTracker timeTracker = new TimeTracker();
+ private final Time time = Time.SYSTEM;
@Override
public void init(final ProcessorContext<Windowed<KIn>, Change<VAgg>>
context) {
super.init(context);
- final InternalProcessorContext<Windowed<KIn>, Change<VAgg>>
internalProcessorContext =
- (InternalProcessorContext<Windowed<KIn>, Change<VAgg>>)
context;
+ internalProcessorContext =
(InternalProcessorContext<Windowed<KIn>, Change<VAgg>>) context;
Review Comment:
This `init()` code looks very alike to the hopping/tumbling window case --
might it be worth to add a new abstract class between
`KStreamAggProcessorSupplier` and
`KStreamSlidingWindowAggregate/KStreamWindowAggregate` that unifies this 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]