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


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/MeteredVersionedKeyValueStore.java:
##########
@@ -157,6 +213,34 @@ protected <R> QueryResult<R> runKeyQuery(final Query<R> 
query,
             throw new UnsupportedOperationException("Versioned stores do not 
support KeyQuery queries at this time.");
         }
 
+        @SuppressWarnings("unchecked")
+        protected <R> QueryResult<R> runMultiVersionedKeyQuery(final Query<R> 
query,
+                                                               final 
PositionBound positionBound,
+                                                               final 
QueryConfig config) {
+            final QueryResult<R> result;
+            final MultiVersionedKeyQuery<K, V> typedKeyQuery = 
(MultiVersionedKeyQuery<K, V>) query;
+
+            final Instant fromTime = typedKeyQuery.fromTime().isPresent() ? 
typedKeyQuery.fromTime().get() : Instant.ofEpochMilli(Long.MIN_VALUE);
+            final Instant toTime = typedKeyQuery.toTime().isPresent() ? 
typedKeyQuery.toTime().get() : Instant.ofEpochMilli(Long.MAX_VALUE);
+            MultiVersionedKeyQuery<Bytes, byte[]> rawKeyQuery = 
MultiVersionedKeyQuery.withKey(keyBytes(typedKeyQuery.key()));
+            rawKeyQuery = rawKeyQuery.fromTime(fromTime).toTime(toTime);
+            if (!typedKeyQuery.isAscending()) {

Review Comment:
   I see. `MultiVersionedKeyQuery` is the public class we add right? Not sure 
if we should extent it. -- Maybe we better to just leave it as-is and go with 
`!typedKeyQuery.isAscending()`?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to