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


##########
core/src/main/scala/kafka/server/KafkaApis.scala:
##########
@@ -1355,6 +1402,60 @@ class KafkaApis(val requestChannel: RequestChannel,
       ))
   }
 
+  def handleDescribeTopicsRequest(request: RequestChannel.Request): Unit = {
+    val describeTopicsRequest = request.body[DescribeTopicsRequest]
+
+    val topics = scala.collection.mutable.Map[String, Int]()
+    describeTopicsRequest.data.topics.forEach { topic =>
+      if (topic.name == null || topic.firstPartitionId() < 0) {
+        throw new InvalidRequestException(s"Topic name and first partition id 
must be set.")
+      }
+      topics.put(topic.name(), topic.firstPartitionId())
+    }
+
+    val fetchAllTopics = topics.isEmpty

Review Comment:
   If there is no topic in the request, it means the client wants all the 
topics.
   firstPartitionIndex is a topic level argument. It only works in the case 
where topics are provided.



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