You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/03/15 14:58:19 UTC

[GitHub] [kafka] dajac opened a new pull request #10319: MINOR; Various code cleanups

dajac opened a new pull request #10319:
URL: https://github.com/apache/kafka/pull/10319


   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac merged pull request #10319: MINOR; Various code cleanups

Posted by GitBox <gi...@apache.org>.
dajac merged pull request #10319:
URL: https://github.com/apache/kafka/pull/10319


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on a change in pull request #10319: MINOR; Various code cleanups

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10319:
URL: https://github.com/apache/kafka/pull/10319#discussion_r594931228



##########
File path: core/src/test/scala/unit/kafka/network/ConnectionQuotasTest.scala
##########
@@ -782,14 +783,14 @@ class ConnectionQuotasTest {
   }
 
   private def verifyNoBlockedPercentRecordedOnAllListeners(): Unit = {
-    blockedPercentMeters.foreach { case (name, meter) =>
+    blockedPercentMeters.forKeyValue { (name, meter) =>

Review comment:
       line#809 and line#761 have similar issue. Could you fix them in this PR?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #10319: MINOR; Various code cleanups

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #10319:
URL: https://github.com/apache/kafka/pull/10319#issuecomment-800139887


   @chia7712 That makes sense. I have updated the PR.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on a change in pull request #10319: MINOR; Various code cleanups

Posted by GitBox <gi...@apache.org>.
chia7712 commented on a change in pull request #10319:
URL: https://github.com/apache/kafka/pull/10319#discussion_r595191354



##########
File path: core/src/main/scala/kafka/admin/ReassignPartitionsCommand.scala
##########
@@ -515,15 +512,14 @@ object ReassignPartitionsCommand extends Logging {
                                       : (Map[TopicPartition, PartitionReassignmentState], Boolean) = {
     val partitionsBeingReassigned = zkClient.getPartitionReassignment
     val results = new mutable.HashMap[TopicPartition, PartitionReassignmentState]()
-    targetReassignments.groupBy(_._1.topic).foreach {
-      case (topic, partitions) =>
-        val replicasForTopic = zkClient.getReplicaAssignmentForTopics(Set(topic))
-        partitions.foreach {
-          case (partition, targetReplicas) =>
-            val currentReplicas = replicasForTopic.getOrElse(partition, Seq())
-            results.put(partition, new PartitionReassignmentState(
-              currentReplicas, targetReplicas, !partitionsBeingReassigned.contains(partition)))
-        }
+    targetReassignments.groupBy(_._1.topic).forKeyValue { (topic, partitions) =>
+      val replicasForTopic = zkClient.getReplicaAssignmentForTopics(Set(topic))
+      partitions.foreach {

Review comment:
       `forKeyValue`




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] dajac commented on pull request #10319: MINOR; Various code cleanups

Posted by GitBox <gi...@apache.org>.
dajac commented on pull request #10319:
URL: https://github.com/apache/kafka/pull/10319#issuecomment-800292138


   @chia7712 I just pushed a commit to address your comment. That commit also improves a catch clause.


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org