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:43:59 GMT
Repository: kafka
Updated Branches:
  refs/heads/0.8.2 80eb04f99 -> 383ac3e19


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/383ac3e1
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/383ac3e1
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/383ac3e1

Branch: refs/heads/0.8.2
Commit: 383ac3e198d6af6f3eb40ab7a42fc73f2f1b4a36
Parents: 80eb04f
Author: Onur Karaman <okaraman@linkedin.com>
Authored: Tue Nov 11 18:43:29 2014 -0800
Committer: Joel Koshy <jjkoshy@gmail.com>
Committed: Tue Nov 11 18:43:29 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/383ac3e1/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