summaryrefslogtreecommitdiff
path: root/kafka/conn.py
diff options
context:
space:
mode:
authorRichard Lee <github@richardlee.name>2018-07-12 11:39:29 -0700
committerJeff Widman <jeff@jeffwidman.com>2018-10-24 22:42:12 -0700
commit481f88068bdf0a18f12fd7a811b795f889d35fc7 (patch)
tree818f3b1ff92c847f90da3e9f2603d8100e899a50 /kafka/conn.py
parentac9d5623116a5754c57a8ecd95b2954ba0f30c14 (diff)
downloadkafka-python-481f88068bdf0a18f12fd7a811b795f889d35fc7.tar.gz
Add KafkaAdmin class
Requires cluster version > 0.10.0.0, and uses new wire protocol classes to do many things via broker connection that previously needed to be done directly in zookeeper.
Diffstat (limited to 'kafka/conn.py')
-rw-r--r--kafka/conn.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/kafka/conn.py b/kafka/conn.py
index ccaa2ed..5ec9757 100644
--- a/kafka/conn.py
+++ b/kafka/conn.py
@@ -873,6 +873,16 @@ class BrokerConnection(object):
])
return self._api_versions
+ def get_api_versions(self):
+ version = self.check_version()
+ if version < (0, 10, 0):
+ raise Errors.UnsupportedVersionError(
+ "ApiVersion not supported by cluster version {} < 0.10.0"
+ .format(version))
+ # _api_versions is set as a side effect of check_versions() on a cluster
+ # that supports 0.10.0 or later
+ return self._api_versions;
+
def _infer_broker_version_from_api_versions(self, api_versions):
# The logic here is to check the list of supported request versions
# in reverse order. As soon as we find one that works, return it