summaryrefslogtreecommitdiff
path: root/kafka/__init__.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@rd.io>2016-01-12 16:52:30 -0800
committerDana Powers <dana.powers@rd.io>2016-01-12 16:52:30 -0800
commit4079a582b07989e683bcb2d87f6d522ed61a4f66 (patch)
treedeba002c4b9ce6407fe8160afceccc25d9660b09 /kafka/__init__.py
parentdcad3fea16028ae00f64baa981553b62666b15fb (diff)
downloadkafka-python-deprecation_warnings.tar.gz
Add DeprecationWarnings to legacy KafkaClient, Simple/MultiProcess/Consumer, and KafkaConnectiondeprecation_warnings
Diffstat (limited to 'kafka/__init__.py')
-rw-r--r--kafka/__init__.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/kafka/__init__.py b/kafka/__init__.py
index 2a99847..68ba597 100644
--- a/kafka/__init__.py
+++ b/kafka/__init__.py
@@ -4,14 +4,28 @@ __author__ = 'Dana Powers'
__license__ = 'Apache License 2.0'
__copyright__ = 'Copyright 2016 Dana Powers, David Arthur, and Contributors'
-from kafka.client import KafkaClient as SimpleClient
-from kafka.client_async import KafkaClient
+from kafka.consumer import KafkaConsumer
from kafka.conn import BrokerConnection
from kafka.protocol import (
create_message, create_gzip_message, create_snappy_message)
-from kafka.producer import SimpleProducer, KeyedProducer
from kafka.partitioner import RoundRobinPartitioner, HashedPartitioner, Murmur2Partitioner
-from kafka.consumer import KafkaConsumer, SimpleConsumer, MultiProcessConsumer
+
+# To be deprecated when KafkaProducer interface is released
+from kafka.client import SimpleClient
+from kafka.producer import SimpleProducer, KeyedProducer
+
+# deprecated in favor of KafkaConsumer
+from kafka.consumer import SimpleConsumer, MultiProcessConsumer
+
+
+import warnings
+class KafkaClient(SimpleClient):
+ def __init__(self, *args, **kwargs):
+ warnings.warn('The legacy KafkaClient interface has been moved to'
+ ' kafka.SimpleClient - this import will break in a'
+ ' future release', DeprecationWarning)
+ super(KafkaClient, self).__init__(*args, **kwargs)
+
__all__ = [
'KafkaConsumer', 'KafkaClient', 'BrokerConnection',