[ 
https://issues.apache.org/jira/browse/KAFKA-7094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16568420#comment-16568420
 ] 

ASF GitHub Bot commented on KAFKA-7094:
---------------------------------------

wangzzu closed pull request #5287: KAFKA-7094: Variate should unify code style 
in one method, and use  camel name
URL: https://github.com/apache/kafka/pull/5287
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/scala/kafka/server/ReplicaManager.scala 
b/core/src/main/scala/kafka/server/ReplicaManager.scala
index 965595b2c2e..6c4ace931b5 100644
--- a/core/src/main/scala/kafka/server/ReplicaManager.scala
+++ b/core/src/main/scala/kafka/server/ReplicaManager.scala
@@ -1069,13 +1069,13 @@ class ReplicaManager(val config: KafkaConfig,
           }
         }
 
-        val partitionsTobeLeader = partitionState.filter { case (_, stateInfo) 
=>
+        val partitionsToBeLeader = partitionState.filter { case (_, stateInfo) 
=>
           stateInfo.basePartitionState.leader == localBrokerId
         }
-        val partitionsToBeFollower = partitionState -- 
partitionsTobeLeader.keys
+        val partitionsToBeFollower = partitionState -- 
partitionsToBeLeader.keys
 
-        val partitionsBecomeLeader = if (partitionsTobeLeader.nonEmpty)
-          makeLeaders(controllerId, controllerEpoch, partitionsTobeLeader, 
correlationId, responseMap)
+        val partitionsBecomeLeader = if (partitionsToBeLeader.nonEmpty)
+          makeLeaders(controllerId, controllerEpoch, partitionsToBeLeader, 
correlationId, responseMap)
         else
           Set.empty[Partition]
         val partitionsBecomeFollower = if (partitionsToBeFollower.nonEmpty)


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Variate should unify code style in one method, and use  camel name
> ------------------------------------------------------------------
>
>                 Key: KAFKA-7094
>                 URL: https://issues.apache.org/jira/browse/KAFKA-7094
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.1
>            Reporter: Matt Wang
>            Priority: Trivial
>
> In one method, there are two variates, partitionsTobeLeader and 
> partitionsToBeFollower, which should use unify code style, that will be 
> helpful to code maintenance.
>  
> https://github.com/apache/kafka/pull/5287 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to