kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjko...@apache.org
Subject kafka git commit: KAFKA-1742; ControllerContext removeTopic does not correctly update state; reviewed by Joel Koshy, Guozhang Wang and Neha Narkhede
Date Wed, 12 Nov 2014 02:42:39 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 9b3da9fbf -> 53160bb07


KAFKA-1742; ControllerContext removeTopic does not correctly update state; reviewed by Joel
Koshy, Guozhang Wang and Neha Narkhede


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

Branch: refs/heads/trunk
Commit: 53160bb07c9f77ed21f486ed448aff0277c139b0
Parents: 9b3da9f
Author: Onur Karaman <okaraman@linkedin.com>
Authored: Tue Nov 11 18:42:22 2014 -0800
Committer: Joel Koshy <jjkoshy@gmail.com>
Committed: Tue Nov 11 18:42:22 2014 -0800

----------------------------------------------------------------------
 core/src/main/scala/kafka/controller/KafkaController.scala | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/53160bb0/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 51a5bad..66df6d2 100644
--- a/core/src/main/scala/kafka/controller/KafkaController.scala
+++ b/core/src/main/scala/kafka/controller/KafkaController.scala
@@ -115,8 +115,8 @@ class ControllerContext(val zkClient: ZkClient,
   }
 
   def removeTopic(topic: String) = {
-    partitionLeadershipInfo = partitionLeadershipInfo.dropWhile(p => p._1.topic.equals(topic))
-    partitionReplicaAssignment = partitionReplicaAssignment.dropWhile(p => p._1.topic.equals(topic))
+    partitionLeadershipInfo = partitionLeadershipInfo.filter{ case (topicAndPartition, _)
=> topicAndPartition.topic != topic }
+    partitionReplicaAssignment = partitionReplicaAssignment.filter{ case (topicAndPartition,
_) => topicAndPartition.topic != topic }
     allTopics -= topic
   }
 }


Mime
View raw message