philipnee commented on code in PR #13380:
URL: https://github.com/apache/kafka/pull/13380#discussion_r1136449438


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/PrototypeAsyncConsumer.java:
##########
@@ -306,13 +310,28 @@ public OffsetAndMetadata committed(TopicPartition 
partition, Duration timeout) {
     }
 
     @Override
-    public Map<TopicPartition, OffsetAndMetadata> 
committed(Set<TopicPartition> partitions) {
-        throw new KafkaException("method not implemented");
+    public Map<TopicPartition, OffsetAndMetadata> committed(final 
Set<TopicPartition> partitions) {
+        return committed(partitions, Duration.ofMillis(defaultApiTimeoutMs));
     }
 
     @Override
-    public Map<TopicPartition, OffsetAndMetadata> 
committed(Set<TopicPartition> partitions, Duration timeout) {
-        throw new KafkaException("method not implemented");
+    public Map<TopicPartition, OffsetAndMetadata> committed(final 
Set<TopicPartition> partitions,
+                                                            final Duration 
timeout) {
+        maybeThrowInvalidGroupIdException();
+        final OffsetFetchApplicationEvent event = new 
OffsetFetchApplicationEvent(partitions);
+        eventHandler.add(event);
+        try {
+            return event.complete(Duration.ofMillis(100));
+        } catch (ExecutionException | InterruptedException | TimeoutException 
e) {
+            throw new KafkaException(e);

Review Comment:
   InterruptedException, TimeoutException -> We can map them to the existing 
kafka exception
   ExecutionException - KafkaException
   There are a few blocking operations like committed(), I think we need to 
support wakeup here. I don't know what's the suggestions here, but I'm thinking 
of running a timer, and check wakeup in that loop.



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