joshua2519 commented on code in PR #20083:
URL: https://github.com/apache/kafka/pull/20083#discussion_r2193983660


##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -1298,7 +1148,7 @@ class Partition(val topicPartition: TopicPartition,
   def getOutOfSyncReplicas(maxLagMs: Long): Set[Int] = {
     val current = partitionState
     if (!current.isInflight) {
-      val candidateReplicaIds = current.isr - localBrokerId
+      val candidateReplicaIds = current.isr.asScala.map(_.toInt).toSet - 
localBrokerId

Review Comment:
   > ditto
   
   @chia7712 
   To reduce collection copies, we could use an iterator like this: 
   `current.isr.asScala.iterator.map(_.toInt).filter(_ != 
localBrokerId)).to(Set)`
   However, this approach is less concise.



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