bbejeck commented on code in PR #22318:
URL: https://github.com/apache/kafka/pull/22318#discussion_r3335950259


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredWindowStore.java:
##########
@@ -380,6 +332,70 @@ public KeyValueIterator<Windowed<K>, V> backwardAll() {
         );
     }
 
+    private final class ReadOnlyView implements ReadOnlyWindowStore<K, V> {
+
+        private final ReadOnlyWindowStore<Bytes, byte[]> underlying;
+
+        ReadOnlyView(final ReadOnlyWindowStore<Bytes, byte[]> underlying) {
+            this.underlying = underlying;
+        }
+
+        @Override
+        public V fetch(final K key, final long windowStartTimestamp) {
+            Objects.requireNonNull(key, "key cannot be null");
+            return maybeMeasureLatency(
+                () -> {
+                    final byte[] result = underlying.fetch(serializeKey(key), 
windowStartTimestamp);
+                    return result == null ? null : deserializeValue(result);
+                },
+                time,
+                fetchSensor
+            );
+        }
+
+        @Override
+        public WindowStoreIterator<V> fetch(final K key, final Instant 
timeFrom, final Instant timeTo) {

Review Comment:
   nit: parameter per line 



##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredWindowStore.java:
##########
@@ -380,6 +332,70 @@ public KeyValueIterator<Windowed<K>, V> backwardAll() {
         );
     }
 
+    private final class ReadOnlyView implements ReadOnlyWindowStore<K, V> {
+
+        private final ReadOnlyWindowStore<Bytes, byte[]> underlying;
+
+        ReadOnlyView(final ReadOnlyWindowStore<Bytes, byte[]> underlying) {
+            this.underlying = underlying;
+        }
+
+        @Override
+        public V fetch(final K key, final long windowStartTimestamp) {
+            Objects.requireNonNull(key, "key cannot be null");
+            return maybeMeasureLatency(
+                () -> {
+                    final byte[] result = underlying.fetch(serializeKey(key), 
windowStartTimestamp);
+                    return result == null ? null : deserializeValue(result);
+                },
+                time,
+                fetchSensor
+            );
+        }
+
+        @Override
+        public WindowStoreIterator<V> fetch(final K key, final Instant 
timeFrom, final Instant timeTo) {

Review Comment:
   nit: parameter per line 



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