summaryrefslogtreecommitdiff
path: root/kafka/common.py
diff options
context:
space:
mode:
authorDana Powers <dana.powers@gmail.com>2016-02-15 16:11:05 -0800
committerDana Powers <dana.powers@gmail.com>2016-02-15 16:12:39 -0800
commit7eeba0d15f977eb3b17a34b8ed57d75520c7aa60 (patch)
tree98e51515348baa3991fb42be485b3911355e8016 /kafka/common.py
parent16c13f91c0fe45a26f9133e619f50dfa3e4fd1e0 (diff)
downloadkafka-python-7eeba0d15f977eb3b17a34b8ed57d75520c7aa60.tar.gz
Mark old kafka.common structs as Deprecated; remove unused TopicMetadata
Diffstat (limited to 'kafka/common.py')
-rw-r--r--kafka/common.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/kafka/common.py b/kafka/common.py
index 3fb5ab2..382867c 100644
--- a/kafka/common.py
+++ b/kafka/common.py
@@ -2,9 +2,8 @@ import inspect
import sys
from collections import namedtuple
-###############
-# Structs #
-###############
+
+# SimpleClient Payload Structs - Deprecated
# https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol#AGuideToTheKafkaProtocol-MetadataAPI
MetadataRequest = namedtuple("MetadataRequest",
@@ -57,29 +56,29 @@ OffsetFetchResponsePayload = namedtuple("OffsetFetchResponsePayload",
# Other useful structs
+TopicPartition = namedtuple("TopicPartition",
+ ["topic", "partition"])
+
BrokerMetadata = namedtuple("BrokerMetadata",
["nodeId", "host", "port"])
-TopicMetadata = namedtuple("TopicMetadata",
- ["topic", "error", "partitions"])
-
PartitionMetadata = namedtuple("PartitionMetadata",
["topic", "partition", "leader", "replicas", "isr", "error"])
+OffsetAndMetadata = namedtuple("OffsetAndMetadata",
+ ["offset", "metadata"])
+
+
+# Deprecated structs
OffsetAndMessage = namedtuple("OffsetAndMessage",
["offset", "message"])
Message = namedtuple("Message",
["magic", "attributes", "key", "value"])
-TopicPartition = namedtuple("TopicPartition",
- ["topic", "partition"])
-
KafkaMessage = namedtuple("KafkaMessage",
["topic", "partition", "offset", "key", "value"])
-OffsetAndMetadata = namedtuple("OffsetAndMetadata",
- ["offset", "metadata"])
# Define retry policy for async producer
# Limit value: int >= 0, 0 means no retries