vvcephei commented on a change in pull request #11582: URL: https://github.com/apache/kafka/pull/11582#discussion_r771736938
########## File path: streams/src/main/java/org/apache/kafka/streams/query/QueryResult.java ########## @@ -197,6 +197,18 @@ public R getResult() { return result; } + @SuppressWarnings("unchecked") + public <V> QueryResult<V> swapResult(final V value) { + if (isFailure()) { + return (QueryResult<V>) this; + } else { + final QueryResult<V> result = new QueryResult<>(value); Review comment: Thanks, @mjsax , I'm not sure precisely what you mean. This does create a new object. If you think it would be clearer to add a constructor allowing people to set the result along with a pre-populated executionInfo and position instead, we could, but this is the API we agreed on in the KIP. I want this new API to have good ergonomics, so I do want to consider these, but I don't think we need to hold up the KeyQuery PR on it. -- 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