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


##########
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:
   Also, we are doing two conversions here - you can avoid one by using a view 
or iterator after `asScala` and using `toBuffer` instead of `toSeq` (the latter 
can result in a lazy collection being created which can result in problems).



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