mjsax commented on code in PR #21580:
URL: https://github.com/apache/kafka/pull/21580#discussion_r2887433056


##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamSlidingWindowAggregate.java:
##########
@@ -457,21 +458,22 @@ protected boolean shouldRangeFetch(final long 
emitRangeLowerBound, final long em
         }
 
         private void updateWindowAndForward(final Window window,
-                                            final ValueAndTimestamp<VAgg> 
valueAndTime,
+                                            final ValueTimestampHeaders<VAgg> 
valueTimestampHeaders,
                                             final Record<KIn, VIn> record,
                                             final long windowCloseTime) {
             final long windowStart = window.start();
             final long windowEnd = window.end();
 
             if (windowEnd >= windowCloseTime) {
                 // get aggregate from existing window
-                final VAgg oldAgg = getValueOrNull(valueAndTime);
+                final VAgg oldAgg = getValueOrNull(valueTimestampHeaders);
                 final VAgg newAgg = aggregator.apply(record.key(), 
record.value(), oldAgg);
 
-                final long newTimestamp = oldAgg == null ? record.timestamp() 
: Math.max(record.timestamp(), valueAndTime.timestamp());
+                final long newTimestamp = oldAgg == null ? record.timestamp() 
: Math.max(record.timestamp(), valueTimestampHeaders.timestamp());
+                final Headers headers  =  oldAgg == null ? record.headers() : 
valueTimestampHeaders.headers();
                 windowStore.put(
                     record.key(),
-                    ValueAndTimestamp.make(newAgg, newTimestamp),
+                    ValueTimestampHeaders.make(newAgg, newTimestamp, headers),

Review Comment:
   `new RecordHeaders()` ?



##########
streams/src/main/java/org/apache/kafka/streams/kstream/internals/KStreamSlidingWindowAggregate.java:
##########
@@ -457,21 +458,22 @@ protected boolean shouldRangeFetch(final long 
emitRangeLowerBound, final long em
         }
 
         private void updateWindowAndForward(final Window window,
-                                            final ValueAndTimestamp<VAgg> 
valueAndTime,
+                                            final ValueTimestampHeaders<VAgg> 
valueTimestampHeaders,
                                             final Record<KIn, VIn> record,
                                             final long windowCloseTime) {
             final long windowStart = window.start();
             final long windowEnd = window.end();
 
             if (windowEnd >= windowCloseTime) {
                 // get aggregate from existing window
-                final VAgg oldAgg = getValueOrNull(valueAndTime);
+                final VAgg oldAgg = getValueOrNull(valueTimestampHeaders);
                 final VAgg newAgg = aggregator.apply(record.key(), 
record.value(), oldAgg);
 
-                final long newTimestamp = oldAgg == null ? record.timestamp() 
: Math.max(record.timestamp(), valueAndTime.timestamp());
+                final long newTimestamp = oldAgg == null ? record.timestamp() 
: Math.max(record.timestamp(), valueTimestampHeaders.timestamp());
+                final Headers headers  =  oldAgg == null ? record.headers() : 
valueTimestampHeaders.headers();

Review Comment:
   I think we don't need this?



-- 
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]

Reply via email to