Jess668 commented on code in PR #22853:
URL: https://github.com/apache/kafka/pull/22853#discussion_r3638677192
##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredSessionStoreWithHeaders.java:
##########
@@ -521,4 +573,71 @@ public Windowed<K> peekNextKey() {
return cachedNext.key;
}
}
+
+ /**
+ * Iterator backing the {@code withKey} form of {@link
TimestampedWindowRangeWithHeadersQuery}:
+ * yields each session as a {@link ReadOnlyRecord} (implemented by {@link
Record}) whose key is a
+ * {@link Windowed} of the deserialized key and the session's window,
carrying the aggregation and
+ * stored headers, with the headers frozen so a caller cannot mutate the
read-only result.
+ *
+ * <p>Unlike the window-store range query's iterator, there is no
negative-timestamp check here:
+ * {@link ReadOnlyRecord#timestamp()} is sourced from the session window's
end, which is validated
+ * non-negative when the window is constructed, so this iterator's {@code
next()} can never throw.
+ */
+ private class MeteredSessionWithHeadersReadOnlyRecordIterator
Review Comment:
agreed, will do a separate follow-up refactor
--
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]