kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guozh...@apache.org
Subject kafka git commit: KAFKA-2317: follow-up of KAFKA1367; reviewed by Guozhang Wang
Date Tue, 07 Jul 2015 20:26:16 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk a99f70feb -> 826276de1


KAFKA-2317: follow-up of KAFKA1367; reviewed by Guozhang Wang


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

Branch: refs/heads/trunk
Commit: 826276de1eaabfebf2a414c69ebcdff17429016c
Parents: a99f70f
Author: Ashish Singh <asingh@cloudera.com>
Authored: Tue Jul 7 13:26:00 2015 -0700
Committer: Guozhang Wang <wangguoz@gmail.com>
Committed: Tue Jul 7 13:26:00 2015 -0700

----------------------------------------------------------------------
 .../main/scala/kafka/controller/KafkaController.scala | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/826276de/core/src/main/scala/kafka/controller/KafkaController.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/controller/KafkaController.scala b/core/src/main/scala/kafka/controller/KafkaController.scala
index 09630d0..20f1499 100755
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -342,6 +342,7 @@ class KafkaController(val config : KafkaConfig, zkClient: ZkClient, val
brokerSt
    */
   def onControllerResignation() {
     // de-register listeners
+    deregisterIsrChangeNotificationListener()
     deregisterReassignedPartitionsListener()
     deregisterPreferredReplicaElectionListener()
 
@@ -891,16 +892,21 @@ class KafkaController(val config : KafkaConfig, zkClient: ZkClient,
val brokerSt
     }
   }
 
-  private def registerReassignedPartitionsListener() = {
-    zkClient.subscribeDataChanges(ZkUtils.ReassignPartitionsPath, partitionReassignedListener)
-  }
-
   private def registerIsrChangeNotificationListener() = {
     debug("Registering IsrChangeNotificationListener")
     ZkUtils.makeSurePersistentPathExists(zkClient, ZkUtils.IsrChangeNotificationPath)
     zkClient.subscribeChildChanges(ZkUtils.IsrChangeNotificationPath, isrChangeNotificationListener)
   }
 
+  private def deregisterIsrChangeNotificationListener() = {
+    debug("De-registering IsrChangeNotificationListener")
+    zkClient.unsubscribeChildChanges(ZkUtils.IsrChangeNotificationPath, isrChangeNotificationListener)
+  }
+
+  private def registerReassignedPartitionsListener() = {
+    zkClient.subscribeDataChanges(ZkUtils.ReassignPartitionsPath, partitionReassignedListener)
+  }
+
   private def deregisterReassignedPartitionsListener() = {
     zkClient.unsubscribeDataChanges(ZkUtils.ReassignPartitionsPath, partitionReassignedListener)
   }


Mime
View raw message