You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2017/06/07 18:32:36 UTC
kafka git commit: KAFKA-5389;
Replace zkClient.exists method with zkUtils.pathExists
Repository: kafka
Updated Branches:
refs/heads/trunk 38ae74644 -> 6aeca1012
KAFKA-5389; Replace zkClient.exists method with zkUtils.pathExists
ijuma can you please review
Author: Balint Molnar <ba...@gmail.com>
Reviewers: Ismael Juma <is...@juma.me.uk>
Closes #3243 from baluchicken/KAFKA-5389
Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/6aeca101
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/6aeca101
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/6aeca101
Branch: refs/heads/trunk
Commit: 6aeca1012356a90d75d58c9294891619e4a7ab81
Parents: 38ae746
Author: Balint Molnar <ba...@gmail.com>
Authored: Wed Jun 7 19:32:33 2017 +0100
Committer: Ismael Juma <is...@juma.me.uk>
Committed: Wed Jun 7 19:32:33 2017 +0100
----------------------------------------------------------------------
.../test/scala/unit/kafka/admin/TopicCommandTest.scala | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kafka/blob/6aeca101/core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
----------------------------------------------------------------------
diff --git a/core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala b/core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
index e72a4e3..53efa34 100644
--- a/core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
+++ b/core/src/test/scala/unit/kafka/admin/TopicCommandTest.scala
@@ -23,7 +23,8 @@ import kafka.utils.TestUtils
import kafka.zk.ZooKeeperTestHarness
import kafka.server.ConfigType
import kafka.admin.TopicCommand.TopicCommandOptions
-import kafka.utils.ZkUtils._
+import kafka.utils.ZkUtils.ConfigChangesPath
+import kafka.utils.ZkUtils.getDeleteTopicPath
import org.apache.kafka.common.errors.TopicExistsException
import org.apache.kafka.common.internals.Topic
@@ -79,9 +80,9 @@ class TopicCommandTest extends ZooKeeperTestHarness with Logging with RackAwareT
// delete the NormalTopic
val deleteOpts = new TopicCommandOptions(Array("--topic", normalTopic))
val deletePath = getDeleteTopicPath(normalTopic)
- assertFalse("Delete path for topic shouldn't exist before deletion.", zkUtils.zkClient.exists(deletePath))
+ assertFalse("Delete path for topic shouldn't exist before deletion.", zkUtils.pathExists(deletePath))
TopicCommand.deleteTopic(zkUtils, deleteOpts)
- assertTrue("Delete path for topic should exist after deletion.", zkUtils.zkClient.exists(deletePath))
+ assertTrue("Delete path for topic should exist after deletion.", zkUtils.pathExists(deletePath))
// create the offset topic
val createOffsetTopicOpts = new TopicCommandOptions(Array("--partitions", numPartitionsOriginal.toString,
@@ -92,11 +93,11 @@ class TopicCommandTest extends ZooKeeperTestHarness with Logging with RackAwareT
// try to delete the Topic.GROUP_METADATA_TOPIC_NAME and make sure it doesn't
val deleteOffsetTopicOpts = new TopicCommandOptions(Array("--topic", Topic.GROUP_METADATA_TOPIC_NAME))
val deleteOffsetTopicPath = getDeleteTopicPath(Topic.GROUP_METADATA_TOPIC_NAME)
- assertFalse("Delete path for topic shouldn't exist before deletion.", zkUtils.zkClient.exists(deleteOffsetTopicPath))
+ assertFalse("Delete path for topic shouldn't exist before deletion.", zkUtils.pathExists(deleteOffsetTopicPath))
intercept[AdminOperationException] {
TopicCommand.deleteTopic(zkUtils, deleteOffsetTopicOpts)
}
- assertFalse("Delete path for topic shouldn't exist after deletion.", zkUtils.zkClient.exists(deleteOffsetTopicPath))
+ assertFalse("Delete path for topic shouldn't exist after deletion.", zkUtils.pathExists(deleteOffsetTopicPath))
}
@Test