aliehsaeedii commented on code in PR #21455:
URL: https://github.com/apache/kafka/pull/21455#discussion_r2841318395


##########
streams/src/main/java/org/apache/kafka/streams/state/internals/TimestampedToHeadersStoreAdapter.java:
##########
@@ -150,37 +145,11 @@ public boolean isOpen() {
     }
 
     @Override
-    public <R> QueryResult<R> query(
-        final Query<R> query,
-        final PositionBound positionBound,
-        final QueryConfig config) {
-
-        final long start = config.isCollectExecutionInfo() ? System.nanoTime() 
: -1L;
-        QueryResult<R> result = store.query(query, positionBound, config);
-
-        // this adapter always needs to return a 
`value-with-timestamp-and-headers` result to hold up its contract
-        // thus, we need to add the empty headers wrapper even for timestamped 
queries
-        if (result.isSuccess()) {
-            if (query instanceof KeyQuery || query instanceof 
TimestampedKeyQuery) {
-                final byte[] timestampedValue = (byte[]) result.getResult();
-                final byte[] valueWithHeaders = 
convertToHeaderFormat(timestampedValue);
-                result = (QueryResult<R>) 
InternalQueryResultUtil.copyAndSubstituteDeserializedResult(result, 
valueWithHeaders);
-            } else if (query instanceof RangeQuery || query instanceof 
TimestampedRangeQuery) {
-                final TimestampedToHeadersRocksIteratorAdapter 
wrappedRocksDBRangeIterator =
-                    new 
TimestampedToHeadersRocksIteratorAdapter((RocksDbIterator) result.getResult());
-                result = (QueryResult<R>) 
InternalQueryResultUtil.copyAndSubstituteDeserializedResult(result, 
wrappedRocksDBRangeIterator);
-            } else {
-                throw new IllegalArgumentException("Unsupported query type: " 
+ query.getClass());
-            }
-        }
-
-        if (config.isCollectExecutionInfo()) {
-            final long end = System.nanoTime();
-            result.addExecutionInfo(
-                "Handled in " + getClass() + " in " + (end - start) + "ns"
-            );
-        }
-        return result;
+    public <R> QueryResult<R> query(final Query<R> query,
+                                    final PositionBound positionBound,
+                                    final QueryConfig config) {
+        throw new UnsupportedOperationException("Querying (IQv2) is not 
supported on TimestampedToHeadersStoreAdapter. " +

Review Comment:
   I changes the message in metered layer as well.



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