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


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -1733,12 +1734,15 @@ class ReplicaManager(val config: KafkaConfig,
         )
 
         // create a list of (topic, partition) pairs to use as keys for this 
delayed fetch operation
-        val delayedFetchKeys = fetchPartitionStatus.map { case (tp, _) => new 
TopicPartitionOperationKey(tp) }.toList
+        val delayedFetchKeys = fetchPartitionStatus.keySet()
+          .stream()
+          .map(new TopicPartitionOperationKey(_))
+          .collect(Collectors.toList[TopicPartitionOperationKey]())

Review Comment:
   I think you can use the `Stream.toList()` directly (no need for `collect`). 
This method was added to `Stream` in Java 16.
   
   



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