vamossagar12 commented on a change in pull request #11211:
URL: https://github.com/apache/kafka/pull/11211#discussion_r698417779
##########
File path:
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredWindowStore.java
##########
@@ -217,6 +230,24 @@ public V fetch(final K key,
final long timeFrom,
final long timeTo) {
Objects.requireNonNull(key, "key cannot be null");
+
+ if (wrapped().persistent()) {
+
+ final long actualWindowStartTime =
getActualWindowStartTime(timeFrom);
+
+ if (timeTo < actualWindowStartTime) {
+ return KeyValueIterators.emptyWindowStoreIterator();
+ }
+
+ return new MeteredWindowStoreIterator<>(
+ wrapped().fetch(keyBytes(key), actualWindowStartTime, timeTo),
+ fetchSensor,
+ streamsMetrics,
+ serdes,
+ time
+ );
Review comment:
For the most part, only getting the actual start time and returning
empty iterator are duplicate. The MeteredWindowStoreIterator object is built
using a different method call every time. Do you think the first part needs to
be abstracted out to a different method? That might also differ across
different methods..
--
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]