CalvinConfluent commented on code in PR #15265:
URL: https://github.com/apache/kafka/pull/15265#discussion_r1505035988


##########
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java:
##########
@@ -36,28 +38,38 @@
 public class DescribeTopicsResult {
     private final Map<Uuid, KafkaFuture<TopicDescription>> topicIdFutures;
     private final Map<String, KafkaFuture<TopicDescription>> nameFutures;
+    private final Iterator<Map.Entry<String, KafkaFuture<TopicDescription>>> 
nameFuturesIterator;
 
     @Deprecated
     protected DescribeTopicsResult(Map<String, KafkaFuture<TopicDescription>> 
futures) {
-        this(null, futures);
+        this(null, futures, null);
     }
 
     // VisibleForTesting
-    protected DescribeTopicsResult(Map<Uuid, KafkaFuture<TopicDescription>> 
topicIdFutures, Map<String, KafkaFuture<TopicDescription>> nameFutures) {
-        if (topicIdFutures != null && nameFutures != null)
-            throw new IllegalArgumentException("topicIdFutures and nameFutures 
cannot both be specified.");
-        if (topicIdFutures == null && nameFutures == null)
-            throw new IllegalArgumentException("topicIdFutures and nameFutures 
cannot both be null.");
+    protected DescribeTopicsResult(
+        Map<Uuid, KafkaFuture<TopicDescription>> topicIdFutures,
+        Map<String, KafkaFuture<TopicDescription>> nameFutures,
+        Iterator<Map.Entry<String, KafkaFuture<TopicDescription>>> 
nameFuturesIterator
+    ) {
+        if (topicIdFutures != null && nameFutures != null && 
nameFuturesIterator != null)

Review Comment:
   Refactored.



##########
clients/src/main/java/org/apache/kafka/clients/admin/DescribeTopicsResult.java:
##########
@@ -36,28 +38,38 @@
 public class DescribeTopicsResult {
     private final Map<Uuid, KafkaFuture<TopicDescription>> topicIdFutures;
     private final Map<String, KafkaFuture<TopicDescription>> nameFutures;
+    private final Iterator<Map.Entry<String, KafkaFuture<TopicDescription>>> 
nameFuturesIterator;
 
     @Deprecated
     protected DescribeTopicsResult(Map<String, KafkaFuture<TopicDescription>> 
futures) {
-        this(null, futures);
+        this(null, futures, null);
     }
 
     // VisibleForTesting
-    protected DescribeTopicsResult(Map<Uuid, KafkaFuture<TopicDescription>> 
topicIdFutures, Map<String, KafkaFuture<TopicDescription>> nameFutures) {
-        if (topicIdFutures != null && nameFutures != null)
-            throw new IllegalArgumentException("topicIdFutures and nameFutures 
cannot both be specified.");
-        if (topicIdFutures == null && nameFutures == null)
-            throw new IllegalArgumentException("topicIdFutures and nameFutures 
cannot both be null.");
+    protected DescribeTopicsResult(
+        Map<Uuid, KafkaFuture<TopicDescription>> topicIdFutures,
+        Map<String, KafkaFuture<TopicDescription>> nameFutures,
+        Iterator<Map.Entry<String, KafkaFuture<TopicDescription>>> 
nameFuturesIterator
+    ) {
+        if (topicIdFutures != null && nameFutures != null && 
nameFuturesIterator != null)
+            throw new IllegalArgumentException("topicIdFutures and nameFutures 
and nameFutureIterator cannot both be specified.");

Review Comment:
   Refactored.



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