aliehsaeedii commented on code in PR #14626: URL: https://github.com/apache/kafka/pull/14626#discussion_r1384174245
########## 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: > Avoid double negation We do not have the `isDescending()` method in the `MultiVersionedKeyQuery` class. Shall I add it? It is actually the getter for the `isAscending` bool property. -- 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