kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jun...@apache.org
Subject [35/40] git commit: kafka-951; Leader election rate may be reported on a non-controller; patched by Jun Rao; reviewed by Swapnil Ghike
Date Thu, 11 Jul 2013 06:37:45 GMT
kafka-951; Leader election rate may be reported on a non-controller; patched by Jun Rao; reviewed
by Swapnil Ghike


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/5a084f7b
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/5a084f7b
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/5a084f7b

Branch: refs/heads/trunk
Commit: 5a084f7be6986ccbe6ede9df0b519d0fd7929d01
Parents: cc6027b
Author: Jun Rao <junrao@gmail.com>
Authored: Sun Jun 23 22:03:14 2013 -0700
Committer: Jun Rao <junrao@gmail.com>
Committed: Sun Jun 23 22:03:14 2013 -0700

----------------------------------------------------------------------
 .../main/scala/kafka/controller/ReplicaStateMachine.scala    | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/5a084f7b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
index 4fbb28e..0c9d436 100644
--- a/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
+++ b/core/src/main/scala/kafka/controller/ReplicaStateMachine.scala
@@ -248,10 +248,10 @@ class ReplicaStateMachine(controller: KafkaController) extends Logging
{
   class BrokerChangeListener() extends IZkChildListener with Logging {
     this.logIdent = "[BrokerChangeListener on Controller " + controller.config.brokerId +
"]: "
     def handleChildChange(parentPath : String, currentBrokerList : java.util.List[String])
{
-      ControllerStats.leaderElectionTimer.time {
-        info("Broker change listener fired for path %s with children %s".format(parentPath,
currentBrokerList.mkString(",")))
-        controllerContext.controllerLock synchronized {
-          if (hasStarted.get) {
+      info("Broker change listener fired for path %s with children %s".format(parentPath,
currentBrokerList.mkString(",")))
+      controllerContext.controllerLock synchronized {
+        if (hasStarted.get) {
+          ControllerStats.leaderElectionTimer.time {
             try {
               val curBrokerIds = currentBrokerList.map(_.toInt).toSet
               val newBrokerIds = curBrokerIds -- controllerContext.liveOrShuttingDownBrokerIds


Mime
View raw message