File tree Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Expand file tree Collapse file tree 5 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ ClusterMetadata
2
+ ===========
3
+
4
+ .. autoclass :: kafka.cluster.ClusterMetadata
5
+ :members:
Original file line number Diff line number Diff line change @@ -6,13 +6,23 @@ Subpackages
6
6
7
7
.. toctree ::
8
8
9
+ kafka.cluster
9
10
kafka.consumer
10
11
kafka.partitioner
11
12
kafka.producer
12
13
13
14
Submodules
14
15
----------
15
16
17
+ kafka.cluster module
18
+ --------------------
19
+
20
+ .. automodule :: kafka.cluster
21
+ :members:
22
+ :undoc-members:
23
+ :show-inheritance:
24
+
25
+
16
26
kafka.client module
17
27
-------------------
18
28
Original file line number Diff line number Diff line change @@ -7,3 +7,4 @@ kafka-python API
7
7
KafkaProducer
8
8
KafkaClient
9
9
BrokerConnection
10
+ ClusterMetadata
Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ class KafkaClient(object):
48
48
49
49
This class is not thread-safe!
50
50
51
+ Attributes:
52
+ cluster (:any:`ClusterMetadata`): Local cache of cluster metadata, retrived
53
+ via MetadataRequests during :meth:`.poll`.
54
+
51
55
Keyword Arguments:
52
56
bootstrap_servers: 'host[:port]' string (or list of 'host[:port]'
53
57
strings) that the consumer should contact to bootstrap initial
Original file line number Diff line number Diff line change 16
16
17
17
18
18
class ClusterMetadata (object ):
19
+ """
20
+ A class to manage kafka cluster metadata.
21
+
22
+ This class does not perform any IO. It simply updates internal state
23
+ given API responses (MetadataResponse, GroupCoordinatorResponse).
24
+
25
+ Keyword Arguments:
26
+ retry_backoff_ms (int): Milliseconds to backoff when retrying on
27
+ errors. Default: 100.
28
+ metadata_max_age_ms (int): The period of time in milliseconds after
29
+ which we force a refresh of metadata even if we haven't seen any
30
+ partition leadership changes to proactively discover any new
31
+ brokers or partitions. Default: 300000
32
+ """
19
33
DEFAULT_CONFIG = {
20
34
'retry_backoff_ms' : 100 ,
21
35
'metadata_max_age_ms' : 300000 ,
You can’t perform that action at this time.
0 commit comments