mjsax commented on code in PR #12037:
URL: https://github.com/apache/kafka/pull/12037#discussion_r849980304
##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamSlidingWindowAggregate.java:
##########
@@ -467,6 +516,72 @@ private boolean rightWindowIsNotEmpty(final
ValueAndTimestamp<VAgg> rightWinAgg,
return rightWinAgg != null && rightWinAgg.timestamp() >
inputRecordTimestamp;
}
+ private void maybeForwardUpdate(final Record<KIn, VIn> record,
+ final Window window,
+ final VAgg oldAgg,
+ final VAgg newAgg,
+ final long newTimestamp) {
+
+ if (emitStrategy.type() == StrategyType.ON_WINDOW_CLOSE) {
+ return;
+ }
+ tupleForwarder.maybeForward(
+ record.withKey(new Windowed<>(record.key(), window))
+ .withValue(new Change<>(newAgg, sendOldValues ? oldAgg :
null))
+ .withTimestamp(newTimestamp));
+ }
+
+ private void maybeForwardFinalResult(final Record<KIn, VIn> record,
final long closeTime) {
Review Comment:
as above: `maybeForwardFinalResult` (and actually also `maybeForwardUpdate`
IIRC) look very similar to hopping/tumbling window code. Can we unify it?
--
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]