diff options
author | Dana Powers <dana.powers@gmail.com> | 2016-04-05 09:34:48 -0700 |
---|---|---|
committer | Dana Powers <dana.powers@gmail.com> | 2016-04-05 09:35:45 -0700 |
commit | 5a14bd8c947251d1a8f848175cc3cf2b07af3411 (patch) | |
tree | a251ddbc60c84405762365429de9b04727653e6c /kafka/client.py | |
parent | 221f56d8a05cdc2d37f85018e4af352b4b2a95c5 (diff) | |
download | kafka-python-5a14bd8c947251d1a8f848175cc3cf2b07af3411.tar.gz |
Update imports from kafka.common -> kafka.errors / kafka.structs
Diffstat (limited to 'kafka/client.py')
-rw-r--r-- | kafka/client.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/kafka/client.py b/kafka/client.py index 99d6fec..2bd2324 100644 --- a/kafka/client.py +++ b/kafka/client.py @@ -7,12 +7,12 @@ import time import six -import kafka.common -from kafka.common import (TopicPartition, BrokerMetadata, UnknownError, - ConnectionError, FailedPayloadsError, +import kafka.errors +from kafka.errors import (UnknownError, ConnectionError, FailedPayloadsError, KafkaTimeoutError, KafkaUnavailableError, LeaderNotAvailableError, UnknownTopicOrPartitionError, NotLeaderForPartitionError, ReplicaNotAvailableError) +from kafka.structs import TopicPartition, BrokerMetadata from kafka.conn import ( collect_hosts, BrokerConnection, DEFAULT_SOCKET_TIMEOUT_SECONDS, @@ -123,7 +123,7 @@ class SimpleClient(object): # If there's a problem with finding the coordinator, raise the # provided error - kafka.common.check_error(resp) + kafka.errors.check_error(resp) # Otherwise return the BrokerMetadata return BrokerMetadata(resp.nodeId, resp.host, resp.port) @@ -389,7 +389,7 @@ class SimpleClient(object): # Or a server api error response try: - kafka.common.check_error(resp) + kafka.errors.check_error(resp) except (UnknownTopicOrPartitionError, NotLeaderForPartitionError): self.reset_topic_metadata(resp.topic) raise @@ -509,7 +509,7 @@ class SimpleClient(object): for error, topic, partitions in resp.topics: # Errors expected for new topics if error: - error_type = kafka.common.kafka_errors.get(error, UnknownError) + error_type = kafka.errors.kafka_errors.get(error, UnknownError) if error_type in (UnknownTopicOrPartitionError, LeaderNotAvailableError): log.error('Error loading topic metadata for %s: %s (%s)', topic, error_type, error) @@ -530,7 +530,7 @@ class SimpleClient(object): # Check for partition errors if error: - error_type = kafka.common.kafka_errors.get(error, UnknownError) + error_type = kafka.errors.kafka_errors.get(error, UnknownError) # If No Leader, topics_to_brokers topic_partition -> None if error_type is LeaderNotAvailableError: |