diff options
author | Jeff Widman <jeff@jeffwidman.com> | 2018-05-22 11:33:36 -0700 |
---|---|---|
committer | Jeff Widman <jeff@jeffwidman.com> | 2018-05-23 15:19:35 -0700 |
commit | c9d783a8211337205bc90c27d1f67beb65ac5d9e (patch) | |
tree | 4906202765841e7f7294fe0ead67d0b0394b4d5b | |
parent | 11cf3973bfc64ab0b4e471fc56dae911df1ec8d9 (diff) | |
download | kafka-python-c9d783a8211337205bc90c27d1f67beb65ac5d9e.tar.gz |
Document methods that return None
If a valid broker in the cluster has no partitions, it will return None rather than an empty set.
Similarly updated a few other methods.
-rw-r--r-- | kafka/cluster.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/kafka/cluster.py b/kafka/cluster.py index 5be3c2f..45f25ad 100644 --- a/kafka/cluster.py +++ b/kafka/cluster.py @@ -96,6 +96,7 @@ class ClusterMetadata(object): Returns: set: {partition (int), ...} + None if topic not found. """ if topic not in self._partitions: return None @@ -119,6 +120,7 @@ class ClusterMetadata(object): Returns: set: {TopicPartition, ...} + None if the broker either has no partitions or does not exist. """ return self._broker_partitions.get(broker_id) @@ -130,6 +132,7 @@ class ClusterMetadata(object): Returns: int: node_id for group coordinator + None if the group does not exist. """ return self._groups.get(group) |