@@ -121,8 +121,7 @@ class KafkaClient(object):
121121 default: none.
122122 api_version (tuple): Specify which Kafka API version to use. If set
123123 to None, KafkaClient will attempt to infer the broker version by
124- probing various APIs. For the full list of supported versions,
125- see KafkaClient.API_VERSIONS. Default: None
124+ probing various APIs. Example: (0, 10, 2). Default: None
126125 api_version_auto_timeout_ms (int): number of milliseconds to throw a
127126 timeout exception from the constructor when checking the broker
128127 api version. Only applies if api_version is None
@@ -176,27 +175,13 @@ class KafkaClient(object):
176175 'sasl_plain_password' : None ,
177176 'sasl_kerberos_service_name' : 'kafka' ,
178177 }
179- API_VERSIONS = [
180- (0 , 10 , 1 ),
181- (0 , 10 , 0 ),
182- (0 , 10 ),
183- (0 , 9 ),
184- (0 , 8 , 2 ),
185- (0 , 8 , 1 ),
186- (0 , 8 , 0 )
187- ]
188178
189179 def __init__ (self , ** configs ):
190180 self .config = copy .copy (self .DEFAULT_CONFIG )
191181 for key in self .config :
192182 if key in configs :
193183 self .config [key ] = configs [key ]
194184
195- if self .config ['api_version' ] is not None :
196- assert self .config ['api_version' ] in self .API_VERSIONS , (
197- 'api_version [{0}] must be one of: {1}' .format (
198- self .config ['api_version' ], str (self .API_VERSIONS )))
199-
200185 self .cluster = ClusterMetadata (** self .config )
201186 self ._topics = set () # empty set will fetch all topic metadata
202187 self ._metadata_refresh_in_progress = False
0 commit comments