kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ewe...@apache.org
Subject kafka git commit: MINOR: add list_topics command to help debug tests
Date Fri, 21 Oct 2016 21:52:10 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk 302a246c7 -> 74014af83


MINOR: add list_topics command to help debug tests

Author: Xavier Léauté <xavier@confluent.io>

Reviewers: Ewen Cheslack-Postava <ewen@confluent.io>

Closes #2052 from xvrl/test-add-list-topics


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

Branch: refs/heads/trunk
Commit: 74014af8332c6ec95133cd7fda3848bcd7fb4ce6
Parents: 302a246
Author: Xavier Léauté <xavier@confluent.io>
Authored: Fri Oct 21 14:52:06 2016 -0700
Committer: Ewen Cheslack-Postava <me@ewencp.org>
Committed: Fri Oct 21 14:52:06 2016 -0700

----------------------------------------------------------------------
 tests/kafkatest/services/kafka/kafka.py | 9 +++++++++
 1 file changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/74014af8/tests/kafkatest/services/kafka/kafka.py
----------------------------------------------------------------------
diff --git a/tests/kafkatest/services/kafka/kafka.py b/tests/kafkatest/services/kafka/kafka.py
index 0caee9a..89cc312 100644
--- a/tests/kafkatest/services/kafka/kafka.py
+++ b/tests/kafkatest/services/kafka/kafka.py
@@ -296,6 +296,15 @@ class KafkaService(KafkaPathResolverMixin, JmxMixin, Service):
             output += line
         return output
 
+    def list_topics(self, topic, node=None):
+        if node is None:
+            node = self.nodes[0]
+        cmd = "%s --zookeeper %s --list" % \
+              (self.path.script("kafka-topics.sh", node), self.zk.connect_setting())
+        for line in node.account.ssh_capture(cmd):
+            if not line.startswith("SLF4J"):
+                yield line.rstrip()
+
     def alter_message_format(self, topic, msg_format_version, node=None):
         if node is None:
             node = self.nodes[0]


Mime
View raw message