DL1231 commented on code in PR #20768:
URL: https://github.com/apache/kafka/pull/20768#discussion_r2479956474


##########
core/src/main/scala/kafka/server/DelayedFetch.scala:
##########
@@ -154,9 +154,9 @@ class DelayedFetch(
    * Upon completion, read whatever data is available and pass to the complete 
callback
    */
   override def onComplete(): Unit = {
-    val fetchInfos = fetchPartitionStatus.map { case (tp, status) =>
+    val fetchInfos = fetchPartitionStatus.asScala.map { case (tp, status) =>
       tp -> status.fetchInfo
-    }
+    }.toSeq

Review Comment:
   The source of `fetchPartitionStatus` comes from `fetchData()`.
   Its type is LinkedHashMap<TopicIdPartition, PartitionData>, so there will be 
no duplicate TPs.



##########
core/src/main/scala/kafka/server/DelayedFetch.scala:
##########
@@ -154,9 +154,9 @@ class DelayedFetch(
    * Upon completion, read whatever data is available and pass to the complete 
callback
    */
   override def onComplete(): Unit = {
-    val fetchInfos = fetchPartitionStatus.map { case (tp, status) =>
+    val fetchInfos = fetchPartitionStatus.asScala.map { case (tp, status) =>
       tp -> status.fetchInfo
-    }
+    }.toSeq

Review Comment:
   The source of `fetchPartitionStatus` comes from `fetchData()`.
   Its type is LinkedHashMap<TopicIdPartition, PartitionData>, so there will be 
no duplicate TPs.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to