skaundinya15 commented on a change in pull request #10743: URL: https://github.com/apache/kafka/pull/10743#discussion_r657473433
########## File path: clients/src/main/java/org/apache/kafka/clients/admin/DeleteConsumerGroupsResult.java ########## @@ -29,9 +32,9 @@ */ @InterfaceStability.Evolving public class DeleteConsumerGroupsResult { - private final Map<String, KafkaFuture<Void>> futures; + private final Map<CoordinatorKey, KafkaFutureImpl<Void>> futures; - DeleteConsumerGroupsResult(final Map<String, KafkaFuture<Void>> futures) { + DeleteConsumerGroupsResult(Map<CoordinatorKey, KafkaFutureImpl<Void>> futures) { Review comment: @dajac @mimaison It looks like the reason we have to do `KafkaFutureImpl` here is because in the `SimpleAdminApiFuture` class, we have a class variable called `futures` which is of type ` private final Map<K, KafkaFutureImpl<V>>`. As a result, we return `KafkaFutureImpl` for the `all()`, `get()` and other methods. We could change all of this to use `KafkaFuture` instead, but this would require us to change the following methods from `protected` to `public`: ```java /** * If not already completed, sets the value returned by get() and related methods to the given * value. */ protected abstract boolean complete(T newValue); /** * If not already completed, causes invocations of get() and related methods to throw the given * exception. */ protected abstract boolean completeExceptionally(Throwable newException); ``` The question here would be should we change these `protected` methods to be `public` so we can maintain just returning a type of `KafkaFuture` or if it's okay to return `KafkaFutureImpl`. I think it could be worth changing `KafkaFuture` methods from `protected` to `public` so that we can maintain the invariant of always returning the type of `KafkaFuture`, but not sure if that would require getting some consensus on the mailing list about this. -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org