kafka-python 3.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. kafka/__init__.py +34 -0
  2. kafka/__main__.py +5 -0
  3. kafka/admin/__init__.py +29 -0
  4. kafka/admin/__main__.py +5 -0
  5. kafka/admin/_acls.py +355 -0
  6. kafka/admin/_cluster.py +359 -0
  7. kafka/admin/_configs.py +479 -0
  8. kafka/admin/_groups.py +754 -0
  9. kafka/admin/_partitions.py +595 -0
  10. kafka/admin/_topics.py +281 -0
  11. kafka/admin/_transactions.py +450 -0
  12. kafka/admin/_users.py +194 -0
  13. kafka/admin/client.py +373 -0
  14. kafka/benchmarks/__init__.py +0 -0
  15. kafka/benchmarks/consumer_performance.py +138 -0
  16. kafka/benchmarks/load_example.py +109 -0
  17. kafka/benchmarks/producer_encode_path.py +201 -0
  18. kafka/benchmarks/producer_performance.py +161 -0
  19. kafka/benchmarks/profile_protocol.py +138 -0
  20. kafka/benchmarks/protocol_old_vs_new.py +447 -0
  21. kafka/benchmarks/record_batch_compose.py +77 -0
  22. kafka/benchmarks/record_batch_read.py +82 -0
  23. kafka/benchmarks/varint_speed.py +426 -0
  24. kafka/cli/__init__.py +36 -0
  25. kafka/cli/admin/__init__.py +117 -0
  26. kafka/cli/admin/acls/__init__.py +9 -0
  27. kafka/cli/admin/acls/common.py +76 -0
  28. kafka/cli/admin/acls/create.py +19 -0
  29. kafka/cli/admin/acls/delete.py +23 -0
  30. kafka/cli/admin/acls/describe.py +16 -0
  31. kafka/cli/admin/cluster/__init__.py +14 -0
  32. kafka/cli/admin/cluster/describe.py +11 -0
  33. kafka/cli/admin/cluster/describe_quorum.py +11 -0
  34. kafka/cli/admin/cluster/features.py +52 -0
  35. kafka/cli/admin/cluster/log_dirs.py +43 -0
  36. kafka/cli/admin/cluster/versions.py +33 -0
  37. kafka/cli/admin/configs/__init__.py +10 -0
  38. kafka/cli/admin/configs/alter.py +43 -0
  39. kafka/cli/admin/configs/common.py +17 -0
  40. kafka/cli/admin/configs/describe.py +30 -0
  41. kafka/cli/admin/configs/list.py +16 -0
  42. kafka/cli/admin/configs/reset.py +20 -0
  43. kafka/cli/admin/groups/__init__.py +16 -0
  44. kafka/cli/admin/groups/alter_offsets.py +30 -0
  45. kafka/cli/admin/groups/delete.py +11 -0
  46. kafka/cli/admin/groups/delete_offsets.py +29 -0
  47. kafka/cli/admin/groups/describe.py +11 -0
  48. kafka/cli/admin/groups/list.py +28 -0
  49. kafka/cli/admin/groups/list_offsets.py +29 -0
  50. kafka/cli/admin/groups/remove_members.py +40 -0
  51. kafka/cli/admin/groups/reset_offsets.py +139 -0
  52. kafka/cli/admin/partitions/__init__.py +21 -0
  53. kafka/cli/admin/partitions/alter_reassignments.py +37 -0
  54. kafka/cli/admin/partitions/create.py +27 -0
  55. kafka/cli/admin/partitions/delete_records.py +31 -0
  56. kafka/cli/admin/partitions/describe.py +36 -0
  57. kafka/cli/admin/partitions/elect_leaders.py +53 -0
  58. kafka/cli/admin/partitions/list_offsets.py +88 -0
  59. kafka/cli/admin/partitions/list_reassignments.py +35 -0
  60. kafka/cli/admin/topics/__init__.py +10 -0
  61. kafka/cli/admin/topics/create.py +13 -0
  62. kafka/cli/admin/topics/delete.py +19 -0
  63. kafka/cli/admin/topics/describe.py +18 -0
  64. kafka/cli/admin/topics/list.py +11 -0
  65. kafka/cli/admin/transactions/__init__.py +17 -0
  66. kafka/cli/admin/transactions/abort.py +38 -0
  67. kafka/cli/admin/transactions/describe.py +24 -0
  68. kafka/cli/admin/transactions/describe_producers.py +29 -0
  69. kafka/cli/admin/transactions/find_hanging.py +26 -0
  70. kafka/cli/admin/transactions/list.py +37 -0
  71. kafka/cli/admin/users/__init__.py +8 -0
  72. kafka/cli/admin/users/alter_user_scram_credentials.py +34 -0
  73. kafka/cli/admin/users/describe_user_scram_credentials.py +15 -0
  74. kafka/cli/common.py +95 -0
  75. kafka/cli/consumer/__init__.py +63 -0
  76. kafka/cli/producer/__init__.py +57 -0
  77. kafka/cluster.py +824 -0
  78. kafka/codec.py +325 -0
  79. kafka/consumer/__init__.py +5 -0
  80. kafka/consumer/__main__.py +5 -0
  81. kafka/consumer/fetcher.py +2012 -0
  82. kafka/consumer/group.py +1347 -0
  83. kafka/consumer/subscription_state.py +897 -0
  84. kafka/coordinator/__init__.py +0 -0
  85. kafka/coordinator/assignors/__init__.py +0 -0
  86. kafka/coordinator/assignors/abstract.py +90 -0
  87. kafka/coordinator/assignors/cooperative_sticky.py +167 -0
  88. kafka/coordinator/assignors/range.py +81 -0
  89. kafka/coordinator/assignors/roundrobin.py +101 -0
  90. kafka/coordinator/assignors/sticky/StickyAssignorUserData.json +37 -0
  91. kafka/coordinator/assignors/sticky/__init__.py +0 -0
  92. kafka/coordinator/assignors/sticky/partition_movements.py +149 -0
  93. kafka/coordinator/assignors/sticky/sorted_set.py +63 -0
  94. kafka/coordinator/assignors/sticky/sticky_assignor.py +665 -0
  95. kafka/coordinator/assignors/sticky/user_data.py +8 -0
  96. kafka/coordinator/base.py +1215 -0
  97. kafka/coordinator/consumer.py +1224 -0
  98. kafka/coordinator/heartbeat.py +82 -0
  99. kafka/coordinator/subscription.py +34 -0
  100. kafka/errors.py +1004 -0
  101. kafka/future.py +166 -0
  102. kafka/metrics/__init__.py +13 -0
  103. kafka/metrics/compound_stat.py +33 -0
  104. kafka/metrics/dict_reporter.py +81 -0
  105. kafka/metrics/kafka_metric.py +36 -0
  106. kafka/metrics/measurable.py +27 -0
  107. kafka/metrics/measurable_stat.py +13 -0
  108. kafka/metrics/metric_config.py +33 -0
  109. kafka/metrics/metric_name.py +105 -0
  110. kafka/metrics/metrics.py +261 -0
  111. kafka/metrics/metrics_reporter.py +53 -0
  112. kafka/metrics/quota.py +41 -0
  113. kafka/metrics/stat.py +19 -0
  114. kafka/metrics/stats/__init__.py +15 -0
  115. kafka/metrics/stats/avg.py +24 -0
  116. kafka/metrics/stats/count.py +17 -0
  117. kafka/metrics/stats/histogram.py +99 -0
  118. kafka/metrics/stats/max_stat.py +17 -0
  119. kafka/metrics/stats/min_stat.py +19 -0
  120. kafka/metrics/stats/percentile.py +14 -0
  121. kafka/metrics/stats/percentiles.py +75 -0
  122. kafka/metrics/stats/rate.py +118 -0
  123. kafka/metrics/stats/sampled_stat.py +99 -0
  124. kafka/metrics/stats/sensor.py +136 -0
  125. kafka/metrics/stats/total.py +15 -0
  126. kafka/net/__init__.py +19 -0
  127. kafka/net/compat.py +165 -0
  128. kafka/net/connection.py +593 -0
  129. kafka/net/http_connect.py +144 -0
  130. kafka/net/inet.py +122 -0
  131. kafka/net/manager.py +451 -0
  132. kafka/net/metrics.py +149 -0
  133. kafka/net/sasl/__init__.py +32 -0
  134. kafka/net/sasl/abc.py +28 -0
  135. kafka/net/sasl/gssapi.py +95 -0
  136. kafka/net/sasl/msk.py +245 -0
  137. kafka/net/sasl/oauth.py +98 -0
  138. kafka/net/sasl/plain.py +42 -0
  139. kafka/net/sasl/scram.py +135 -0
  140. kafka/net/sasl/sspi.py +111 -0
  141. kafka/net/selector.py +644 -0
  142. kafka/net/socks5.py +262 -0
  143. kafka/net/transport.py +415 -0
  144. kafka/net/wakeup_notifier.py +72 -0
  145. kafka/partitioner/__init__.py +8 -0
  146. kafka/partitioner/abc.py +8 -0
  147. kafka/partitioner/default.py +89 -0
  148. kafka/partitioner/sticky.py +109 -0
  149. kafka/producer/__init__.py +5 -0
  150. kafka/producer/__main__.py +5 -0
  151. kafka/producer/future.py +101 -0
  152. kafka/producer/kafka.py +1123 -0
  153. kafka/producer/producer_batch.py +192 -0
  154. kafka/producer/record_accumulator.py +647 -0
  155. kafka/producer/sender.py +884 -0
  156. kafka/producer/transaction_manager.py +1326 -0
  157. kafka/protocol/__init__.py +0 -0
  158. kafka/protocol/admin/__init__.py +29 -0
  159. kafka/protocol/admin/acl.py +83 -0
  160. kafka/protocol/admin/acl.pyi +375 -0
  161. kafka/protocol/admin/client_quotas.py +14 -0
  162. kafka/protocol/admin/client_quotas.pyi +265 -0
  163. kafka/protocol/admin/cluster.py +31 -0
  164. kafka/protocol/admin/cluster.pyi +620 -0
  165. kafka/protocol/admin/configs.py +22 -0
  166. kafka/protocol/admin/configs.pyi +437 -0
  167. kafka/protocol/admin/groups.py +24 -0
  168. kafka/protocol/admin/groups.pyi +261 -0
  169. kafka/protocol/admin/topics.py +53 -0
  170. kafka/protocol/admin/topics.pyi +982 -0
  171. kafka/protocol/admin/transactions.py +18 -0
  172. kafka/protocol/admin/transactions.pyi +311 -0
  173. kafka/protocol/admin/users.py +14 -0
  174. kafka/protocol/admin/users.pyi +223 -0
  175. kafka/protocol/api_data.py +125 -0
  176. kafka/protocol/api_header.py +55 -0
  177. kafka/protocol/api_key.py +97 -0
  178. kafka/protocol/api_message.py +277 -0
  179. kafka/protocol/broker_version_data.py +246 -0
  180. kafka/protocol/consumer/__init__.py +13 -0
  181. kafka/protocol/consumer/fetch.py +16 -0
  182. kafka/protocol/consumer/fetch.pyi +298 -0
  183. kafka/protocol/consumer/group.py +38 -0
  184. kafka/protocol/consumer/group.pyi +824 -0
  185. kafka/protocol/consumer/metadata.py +30 -0
  186. kafka/protocol/consumer/metadata.pyi +89 -0
  187. kafka/protocol/consumer/offsets.py +75 -0
  188. kafka/protocol/consumer/offsets.pyi +288 -0
  189. kafka/protocol/data_container.py +166 -0
  190. kafka/protocol/frame.py +30 -0
  191. kafka/protocol/generate_stubs.py +468 -0
  192. kafka/protocol/metadata/__init__.py +10 -0
  193. kafka/protocol/metadata/api_versions.py +41 -0
  194. kafka/protocol/metadata/api_versions.pyi +128 -0
  195. kafka/protocol/metadata/find_coordinator.py +19 -0
  196. kafka/protocol/metadata/find_coordinator.pyi +105 -0
  197. kafka/protocol/metadata/metadata.py +34 -0
  198. kafka/protocol/metadata/metadata.pyi +160 -0
  199. kafka/protocol/old/__init__.py +0 -0
  200. kafka/protocol/old/abstract.py +17 -0
  201. kafka/protocol/old/add_offsets_to_txn.py +54 -0
  202. kafka/protocol/old/add_partitions_to_txn.py +71 -0
  203. kafka/protocol/old/admin.py +1086 -0
  204. kafka/protocol/old/api.py +205 -0
  205. kafka/protocol/old/api_versions.py +133 -0
  206. kafka/protocol/old/commit.py +355 -0
  207. kafka/protocol/old/consumer_protocol.py +36 -0
  208. kafka/protocol/old/end_txn.py +53 -0
  209. kafka/protocol/old/fetch.py +408 -0
  210. kafka/protocol/old/find_coordinator.py +72 -0
  211. kafka/protocol/old/group.py +451 -0
  212. kafka/protocol/old/init_producer_id.py +42 -0
  213. kafka/protocol/old/list_offsets.py +186 -0
  214. kafka/protocol/old/metadata.py +290 -0
  215. kafka/protocol/old/offset_for_leader_epoch.py +133 -0
  216. kafka/protocol/old/produce.py +247 -0
  217. kafka/protocol/old/sasl_authenticate.py +38 -0
  218. kafka/protocol/old/sasl_handshake.py +39 -0
  219. kafka/protocol/old/struct.py +87 -0
  220. kafka/protocol/old/txn_offset_commit.py +73 -0
  221. kafka/protocol/old/types.py +440 -0
  222. kafka/protocol/parser.py +191 -0
  223. kafka/protocol/producer/__init__.py +7 -0
  224. kafka/protocol/producer/produce.py +17 -0
  225. kafka/protocol/producer/produce.pyi +197 -0
  226. kafka/protocol/producer/transaction.py +30 -0
  227. kafka/protocol/producer/transaction.pyi +663 -0
  228. kafka/protocol/sasl.py +52 -0
  229. kafka/protocol/sasl.pyi +126 -0
  230. kafka/protocol/schemas/__init__.py +7 -0
  231. kafka/protocol/schemas/fields/__init__.py +7 -0
  232. kafka/protocol/schemas/fields/array.py +127 -0
  233. kafka/protocol/schemas/fields/base.py +156 -0
  234. kafka/protocol/schemas/fields/codecs/__init__.py +12 -0
  235. kafka/protocol/schemas/fields/codecs/encode_buffer.py +82 -0
  236. kafka/protocol/schemas/fields/codecs/tagged_fields.py +109 -0
  237. kafka/protocol/schemas/fields/codecs/types.py +505 -0
  238. kafka/protocol/schemas/fields/codegen.py +40 -0
  239. kafka/protocol/schemas/fields/simple.py +127 -0
  240. kafka/protocol/schemas/fields/struct.py +357 -0
  241. kafka/protocol/schemas/fields/struct_array.py +142 -0
  242. kafka/protocol/schemas/load_json.py +42 -0
  243. kafka/protocol/schemas/resources/AddOffsetsToTxnRequest.json +40 -0
  244. kafka/protocol/schemas/resources/AddOffsetsToTxnResponse.json +35 -0
  245. kafka/protocol/schemas/resources/AddPartitionsToTxnRequest.json +65 -0
  246. kafka/protocol/schemas/resources/AddPartitionsToTxnResponse.json +60 -0
  247. kafka/protocol/schemas/resources/AlterClientQuotasRequest.json +47 -0
  248. kafka/protocol/schemas/resources/AlterClientQuotasResponse.json +41 -0
  249. kafka/protocol/schemas/resources/AlterConfigsRequest.json +43 -0
  250. kafka/protocol/schemas/resources/AlterConfigsResponse.json +39 -0
  251. kafka/protocol/schemas/resources/AlterPartitionReassignmentsRequest.json +42 -0
  252. kafka/protocol/schemas/resources/AlterPartitionReassignmentsResponse.json +47 -0
  253. kafka/protocol/schemas/resources/AlterReplicaLogDirsRequest.json +41 -0
  254. kafka/protocol/schemas/resources/AlterReplicaLogDirsResponse.json +41 -0
  255. kafka/protocol/schemas/resources/AlterUserScramCredentialsRequest.json +45 -0
  256. kafka/protocol/schemas/resources/AlterUserScramCredentialsResponse.json +35 -0
  257. kafka/protocol/schemas/resources/ApiVersionsRequest.json +34 -0
  258. kafka/protocol/schemas/resources/ApiVersionsResponse.json +79 -0
  259. kafka/protocol/schemas/resources/ConsumerProtocolAssignment.json +42 -0
  260. kafka/protocol/schemas/resources/ConsumerProtocolSubscription.json +49 -0
  261. kafka/protocol/schemas/resources/CreateAclsRequest.json +46 -0
  262. kafka/protocol/schemas/resources/CreateAclsResponse.json +37 -0
  263. kafka/protocol/schemas/resources/CreatePartitionsRequest.json +47 -0
  264. kafka/protocol/schemas/resources/CreatePartitionsResponse.json +41 -0
  265. kafka/protocol/schemas/resources/CreateTopicsRequest.json +65 -0
  266. kafka/protocol/schemas/resources/CreateTopicsResponse.json +72 -0
  267. kafka/protocol/schemas/resources/DeleteAclsRequest.json +46 -0
  268. kafka/protocol/schemas/resources/DeleteAclsResponse.json +59 -0
  269. kafka/protocol/schemas/resources/DeleteGroupsRequest.json +30 -0
  270. kafka/protocol/schemas/resources/DeleteGroupsResponse.json +36 -0
  271. kafka/protocol/schemas/resources/DeleteRecordsRequest.json +42 -0
  272. kafka/protocol/schemas/resources/DeleteRecordsResponse.json +43 -0
  273. kafka/protocol/schemas/resources/DeleteTopicsRequest.json +43 -0
  274. kafka/protocol/schemas/resources/DeleteTopicsResponse.json +52 -0
  275. kafka/protocol/schemas/resources/DescribeAclsRequest.json +43 -0
  276. kafka/protocol/schemas/resources/DescribeAclsResponse.json +55 -0
  277. kafka/protocol/schemas/resources/DescribeClientQuotasRequest.json +37 -0
  278. kafka/protocol/schemas/resources/DescribeClientQuotasResponse.json +47 -0
  279. kafka/protocol/schemas/resources/DescribeClusterRequest.json +35 -0
  280. kafka/protocol/schemas/resources/DescribeClusterResponse.json +56 -0
  281. kafka/protocol/schemas/resources/DescribeConfigsRequest.json +42 -0
  282. kafka/protocol/schemas/resources/DescribeConfigsResponse.json +69 -0
  283. kafka/protocol/schemas/resources/DescribeGroupsRequest.json +38 -0
  284. kafka/protocol/schemas/resources/DescribeGroupsResponse.json +74 -0
  285. kafka/protocol/schemas/resources/DescribeLogDirsRequest.json +38 -0
  286. kafka/protocol/schemas/resources/DescribeLogDirsResponse.json +65 -0
  287. kafka/protocol/schemas/resources/DescribeProducersRequest.json +32 -0
  288. kafka/protocol/schemas/resources/DescribeProducersResponse.json +55 -0
  289. kafka/protocol/schemas/resources/DescribeQuorumRequest.json +39 -0
  290. kafka/protocol/schemas/resources/DescribeQuorumResponse.json +82 -0
  291. kafka/protocol/schemas/resources/DescribeTopicPartitionsRequest.json +40 -0
  292. kafka/protocol/schemas/resources/DescribeTopicPartitionsResponse.json +66 -0
  293. kafka/protocol/schemas/resources/DescribeTransactionsRequest.json +27 -0
  294. kafka/protocol/schemas/resources/DescribeTransactionsResponse.json +52 -0
  295. kafka/protocol/schemas/resources/DescribeUserScramCredentialsRequest.json +30 -0
  296. kafka/protocol/schemas/resources/DescribeUserScramCredentialsResponse.json +45 -0
  297. kafka/protocol/schemas/resources/ElectLeadersRequest.json +41 -0
  298. kafka/protocol/schemas/resources/ElectLeadersResponse.json +45 -0
  299. kafka/protocol/schemas/resources/EndTxnRequest.json +43 -0
  300. kafka/protocol/schemas/resources/EndTxnResponse.json +41 -0
  301. kafka/protocol/schemas/resources/FetchRequest.json +125 -0
  302. kafka/protocol/schemas/resources/FetchResponse.json +124 -0
  303. kafka/protocol/schemas/resources/FindCoordinatorRequest.json +43 -0
  304. kafka/protocol/schemas/resources/FindCoordinatorResponse.json +58 -0
  305. kafka/protocol/schemas/resources/HeartbeatRequest.json +39 -0
  306. kafka/protocol/schemas/resources/HeartbeatResponse.json +35 -0
  307. kafka/protocol/schemas/resources/IncrementalAlterConfigsRequest.json +44 -0
  308. kafka/protocol/schemas/resources/IncrementalAlterConfigsResponse.json +38 -0
  309. kafka/protocol/schemas/resources/InitProducerIdRequest.json +50 -0
  310. kafka/protocol/schemas/resources/InitProducerIdResponse.json +47 -0
  311. kafka/protocol/schemas/resources/JoinGroupRequest.json +63 -0
  312. kafka/protocol/schemas/resources/JoinGroupResponse.json +69 -0
  313. kafka/protocol/schemas/resources/LeaveGroupRequest.json +47 -0
  314. kafka/protocol/schemas/resources/LeaveGroupResponse.json +47 -0
  315. kafka/protocol/schemas/resources/ListConfigResourcesRequest.json +31 -0
  316. kafka/protocol/schemas/resources/ListConfigResourcesResponse.json +37 -0
  317. kafka/protocol/schemas/resources/ListGroupsRequest.json +36 -0
  318. kafka/protocol/schemas/resources/ListGroupsResponse.json +49 -0
  319. kafka/protocol/schemas/resources/ListOffsetsRequest.json +72 -0
  320. kafka/protocol/schemas/resources/ListOffsetsResponse.json +71 -0
  321. kafka/protocol/schemas/resources/ListPartitionReassignmentsRequest.json +34 -0
  322. kafka/protocol/schemas/resources/ListPartitionReassignmentsResponse.json +46 -0
  323. kafka/protocol/schemas/resources/ListTransactionsRequest.json +40 -0
  324. kafka/protocol/schemas/resources/ListTransactionsResponse.json +42 -0
  325. kafka/protocol/schemas/resources/MetadataRequest.json +56 -0
  326. kafka/protocol/schemas/resources/MetadataResponse.json +101 -0
  327. kafka/protocol/schemas/resources/OffsetCommitRequest.json +76 -0
  328. kafka/protocol/schemas/resources/OffsetCommitResponse.json +71 -0
  329. kafka/protocol/schemas/resources/OffsetDeleteRequest.json +39 -0
  330. kafka/protocol/schemas/resources/OffsetDeleteResponse.json +42 -0
  331. kafka/protocol/schemas/resources/OffsetFetchRequest.json +76 -0
  332. kafka/protocol/schemas/resources/OffsetFetchResponse.json +107 -0
  333. kafka/protocol/schemas/resources/OffsetForLeaderEpochRequest.json +52 -0
  334. kafka/protocol/schemas/resources/OffsetForLeaderEpochResponse.json +51 -0
  335. kafka/protocol/schemas/resources/ProduceRequest.json +73 -0
  336. kafka/protocol/schemas/resources/ProduceResponse.json +96 -0
  337. kafka/protocol/schemas/resources/RequestHeader.json +44 -0
  338. kafka/protocol/schemas/resources/ResponseHeader.json +26 -0
  339. kafka/protocol/schemas/resources/SaslAuthenticateRequest.json +29 -0
  340. kafka/protocol/schemas/resources/SaslAuthenticateResponse.json +34 -0
  341. kafka/protocol/schemas/resources/SaslHandshakeRequest.json +31 -0
  342. kafka/protocol/schemas/resources/SaslHandshakeResponse.json +32 -0
  343. kafka/protocol/schemas/resources/SyncGroupRequest.json +56 -0
  344. kafka/protocol/schemas/resources/SyncGroupResponse.json +46 -0
  345. kafka/protocol/schemas/resources/TxnOffsetCommitRequest.json +68 -0
  346. kafka/protocol/schemas/resources/TxnOffsetCommitResponse.json +47 -0
  347. kafka/protocol/schemas/resources/UpdateFeaturesRequest.json +43 -0
  348. kafka/protocol/schemas/resources/UpdateFeaturesResponse.json +39 -0
  349. kafka/protocol/schemas/resources/WriteTxnMarkersRequest.json +49 -0
  350. kafka/protocol/schemas/resources/WriteTxnMarkersResponse.json +45 -0
  351. kafka/protocol/schemas/resources/__init__.py +0 -0
  352. kafka/record/__init__.py +3 -0
  353. kafka/record/_crc32c.py +161 -0
  354. kafka/record/abc.py +144 -0
  355. kafka/record/default_records.py +782 -0
  356. kafka/record/legacy_records.py +587 -0
  357. kafka/record/memory_records.py +255 -0
  358. kafka/record/util.py +135 -0
  359. kafka/serializer/__init__.py +4 -0
  360. kafka/serializer/abstract.py +20 -0
  361. kafka/serializer/default.py +16 -0
  362. kafka/serializer/json.py +17 -0
  363. kafka/serializer/wrapper.py +21 -0
  364. kafka/structs.py +69 -0
  365. kafka/util.py +159 -0
  366. kafka/vendor/__init__.py +0 -0
  367. kafka/version.py +1 -0
  368. kafka_python-3.0.0.dist-info/METADATA +319 -0
  369. kafka_python-3.0.0.dist-info/RECORD +373 -0
  370. kafka_python-3.0.0.dist-info/WHEEL +5 -0
  371. kafka_python-3.0.0.dist-info/entry_points.txt +2 -0
  372. kafka_python-3.0.0.dist-info/licenses/LICENSE +202 -0
  373. kafka_python-3.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,982 @@
1
+ # Generated by generate_stubs.py (Python 3.14)
2
+ import uuid
3
+ from typing import Any, Self
4
+
5
+ from enum import IntEnum
6
+ from kafka.protocol.api_message import ApiMessage
7
+ from kafka.protocol.data_container import DataContainer
8
+
9
+ __all__ = ['CreateTopicsRequest', 'CreateTopicsResponse', 'DeleteTopicsRequest', 'DeleteTopicsResponse', 'CreatePartitionsRequest', 'CreatePartitionsResponse', 'AlterPartitionReassignmentsRequest', 'AlterPartitionReassignmentsResponse', 'ListPartitionReassignmentsRequest', 'ListPartitionReassignmentsResponse', 'DescribeTopicPartitionsRequest', 'DescribeTopicPartitionsResponse', 'DeleteRecordsRequest', 'DeleteRecordsResponse', 'ElectLeadersRequest', 'ElectLeadersResponse', 'ElectionType']
10
+
11
+ class CreateTopicsRequest(ApiMessage):
12
+ class CreatableTopic(DataContainer):
13
+ class CreatableReplicaAssignment(DataContainer):
14
+ partition_index: int
15
+ broker_ids: list[int]
16
+ def __init__(
17
+ self,
18
+ *args: Any,
19
+ partition_index: int = ...,
20
+ broker_ids: list[int] = ...,
21
+ version: int | None = None,
22
+ **kwargs: Any,
23
+ ) -> None: ...
24
+ @property
25
+ def version(self) -> int | None: ...
26
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
27
+
28
+ class CreatableTopicConfig(DataContainer):
29
+ name: str
30
+ value: str | None
31
+ def __init__(
32
+ self,
33
+ *args: Any,
34
+ name: str = ...,
35
+ value: str | None = ...,
36
+ version: int | None = None,
37
+ **kwargs: Any,
38
+ ) -> None: ...
39
+ @property
40
+ def version(self) -> int | None: ...
41
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
42
+
43
+ name: str
44
+ num_partitions: int
45
+ replication_factor: int
46
+ assignments: list[CreatableReplicaAssignment]
47
+ configs: list[CreatableTopicConfig]
48
+ def __init__(
49
+ self,
50
+ *args: Any,
51
+ name: str = ...,
52
+ num_partitions: int = ...,
53
+ replication_factor: int = ...,
54
+ assignments: list[CreatableReplicaAssignment] = ...,
55
+ configs: list[CreatableTopicConfig] = ...,
56
+ version: int | None = None,
57
+ **kwargs: Any,
58
+ ) -> None: ...
59
+ @property
60
+ def version(self) -> int | None: ...
61
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
62
+
63
+ topics: list[CreatableTopic]
64
+ timeout_ms: int
65
+ validate_only: bool
66
+ def __init__(
67
+ self,
68
+ *args: Any,
69
+ topics: list[CreatableTopic] = ...,
70
+ timeout_ms: int = ...,
71
+ validate_only: bool = ...,
72
+ version: int | None = None,
73
+ **kwargs: Any,
74
+ ) -> None: ...
75
+ @property
76
+ def version(self) -> int | None: ...
77
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
78
+ name: str
79
+ type: str
80
+ API_KEY: int
81
+ API_VERSION: int
82
+ valid_versions: tuple[int, int]
83
+ min_version: int
84
+ max_version: int
85
+ @property
86
+ def header(self) -> Any: ...
87
+ @classmethod
88
+ def is_request(cls) -> bool: ...
89
+ def expect_response(self) -> bool: ...
90
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
91
+
92
+ class CreateTopicsResponse(ApiMessage):
93
+ class CreatableTopicResult(DataContainer):
94
+ class CreatableTopicConfigs(DataContainer):
95
+ name: str
96
+ value: str | None
97
+ read_only: bool
98
+ config_source: int
99
+ is_sensitive: bool
100
+ def __init__(
101
+ self,
102
+ *args: Any,
103
+ name: str = ...,
104
+ value: str | None = ...,
105
+ read_only: bool = ...,
106
+ config_source: int = ...,
107
+ is_sensitive: bool = ...,
108
+ version: int | None = None,
109
+ **kwargs: Any,
110
+ ) -> None: ...
111
+ @property
112
+ def version(self) -> int | None: ...
113
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
114
+
115
+ name: str
116
+ topic_id: uuid.UUID
117
+ error_code: int
118
+ error_message: str | None
119
+ topic_config_error_code: int
120
+ num_partitions: int
121
+ replication_factor: int
122
+ configs: list[CreatableTopicConfigs] | None
123
+ def __init__(
124
+ self,
125
+ *args: Any,
126
+ name: str = ...,
127
+ topic_id: uuid.UUID = ...,
128
+ error_code: int = ...,
129
+ error_message: str | None = ...,
130
+ topic_config_error_code: int = ...,
131
+ num_partitions: int = ...,
132
+ replication_factor: int = ...,
133
+ configs: list[CreatableTopicConfigs] | None = ...,
134
+ version: int | None = None,
135
+ **kwargs: Any,
136
+ ) -> None: ...
137
+ @property
138
+ def version(self) -> int | None: ...
139
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
140
+
141
+ throttle_time_ms: int
142
+ topics: list[CreatableTopicResult]
143
+ def __init__(
144
+ self,
145
+ *args: Any,
146
+ throttle_time_ms: int = ...,
147
+ topics: list[CreatableTopicResult] = ...,
148
+ version: int | None = None,
149
+ **kwargs: Any,
150
+ ) -> None: ...
151
+ @property
152
+ def version(self) -> int | None: ...
153
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
154
+ name: str
155
+ type: str
156
+ API_KEY: int
157
+ API_VERSION: int
158
+ valid_versions: tuple[int, int]
159
+ min_version: int
160
+ max_version: int
161
+ @property
162
+ def header(self) -> Any: ...
163
+ @classmethod
164
+ def is_request(cls) -> bool: ...
165
+ def expect_response(self) -> bool: ...
166
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
167
+
168
+ class DeleteTopicsRequest(ApiMessage):
169
+ class DeleteTopicState(DataContainer):
170
+ name: str | None
171
+ topic_id: uuid.UUID
172
+ def __init__(
173
+ self,
174
+ *args: Any,
175
+ name: str | None = ...,
176
+ topic_id: uuid.UUID = ...,
177
+ version: int | None = None,
178
+ **kwargs: Any,
179
+ ) -> None: ...
180
+ @property
181
+ def version(self) -> int | None: ...
182
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
183
+
184
+ topics: list[DeleteTopicState]
185
+ topic_names: list[str]
186
+ timeout_ms: int
187
+ def __init__(
188
+ self,
189
+ *args: Any,
190
+ topics: list[DeleteTopicState] = ...,
191
+ topic_names: list[str] = ...,
192
+ timeout_ms: int = ...,
193
+ version: int | None = None,
194
+ **kwargs: Any,
195
+ ) -> None: ...
196
+ @property
197
+ def version(self) -> int | None: ...
198
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
199
+ name: str
200
+ type: str
201
+ API_KEY: int
202
+ API_VERSION: int
203
+ valid_versions: tuple[int, int]
204
+ min_version: int
205
+ max_version: int
206
+ @property
207
+ def header(self) -> Any: ...
208
+ @classmethod
209
+ def is_request(cls) -> bool: ...
210
+ def expect_response(self) -> bool: ...
211
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
212
+
213
+ class DeleteTopicsResponse(ApiMessage):
214
+ class DeletableTopicResult(DataContainer):
215
+ name: str | None
216
+ topic_id: uuid.UUID
217
+ error_code: int
218
+ error_message: str | None
219
+ def __init__(
220
+ self,
221
+ *args: Any,
222
+ name: str | None = ...,
223
+ topic_id: uuid.UUID = ...,
224
+ error_code: int = ...,
225
+ error_message: str | None = ...,
226
+ version: int | None = None,
227
+ **kwargs: Any,
228
+ ) -> None: ...
229
+ @property
230
+ def version(self) -> int | None: ...
231
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
232
+
233
+ throttle_time_ms: int
234
+ responses: list[DeletableTopicResult]
235
+ def __init__(
236
+ self,
237
+ *args: Any,
238
+ throttle_time_ms: int = ...,
239
+ responses: list[DeletableTopicResult] = ...,
240
+ version: int | None = None,
241
+ **kwargs: Any,
242
+ ) -> None: ...
243
+ @property
244
+ def version(self) -> int | None: ...
245
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
246
+ name: str
247
+ type: str
248
+ API_KEY: int
249
+ API_VERSION: int
250
+ valid_versions: tuple[int, int]
251
+ min_version: int
252
+ max_version: int
253
+ @property
254
+ def header(self) -> Any: ...
255
+ @classmethod
256
+ def is_request(cls) -> bool: ...
257
+ def expect_response(self) -> bool: ...
258
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
259
+
260
+ class CreatePartitionsRequest(ApiMessage):
261
+ class CreatePartitionsTopic(DataContainer):
262
+ class CreatePartitionsAssignment(DataContainer):
263
+ broker_ids: list[int]
264
+ def __init__(
265
+ self,
266
+ *args: Any,
267
+ broker_ids: list[int] = ...,
268
+ version: int | None = None,
269
+ **kwargs: Any,
270
+ ) -> None: ...
271
+ @property
272
+ def version(self) -> int | None: ...
273
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
274
+
275
+ name: str
276
+ count: int
277
+ assignments: list[CreatePartitionsAssignment] | None
278
+ def __init__(
279
+ self,
280
+ *args: Any,
281
+ name: str = ...,
282
+ count: int = ...,
283
+ assignments: list[CreatePartitionsAssignment] | None = ...,
284
+ version: int | None = None,
285
+ **kwargs: Any,
286
+ ) -> None: ...
287
+ @property
288
+ def version(self) -> int | None: ...
289
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
290
+
291
+ topics: list[CreatePartitionsTopic]
292
+ timeout_ms: int
293
+ validate_only: bool
294
+ def __init__(
295
+ self,
296
+ *args: Any,
297
+ topics: list[CreatePartitionsTopic] = ...,
298
+ timeout_ms: int = ...,
299
+ validate_only: bool = ...,
300
+ version: int | None = None,
301
+ **kwargs: Any,
302
+ ) -> None: ...
303
+ @property
304
+ def version(self) -> int | None: ...
305
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
306
+ name: str
307
+ type: str
308
+ API_KEY: int
309
+ API_VERSION: int
310
+ valid_versions: tuple[int, int]
311
+ min_version: int
312
+ max_version: int
313
+ @property
314
+ def header(self) -> Any: ...
315
+ @classmethod
316
+ def is_request(cls) -> bool: ...
317
+ def expect_response(self) -> bool: ...
318
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
319
+
320
+ class CreatePartitionsResponse(ApiMessage):
321
+ class CreatePartitionsTopicResult(DataContainer):
322
+ name: str
323
+ error_code: int
324
+ error_message: str | None
325
+ def __init__(
326
+ self,
327
+ *args: Any,
328
+ name: str = ...,
329
+ error_code: int = ...,
330
+ error_message: str | None = ...,
331
+ version: int | None = None,
332
+ **kwargs: Any,
333
+ ) -> None: ...
334
+ @property
335
+ def version(self) -> int | None: ...
336
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
337
+
338
+ throttle_time_ms: int
339
+ results: list[CreatePartitionsTopicResult]
340
+ def __init__(
341
+ self,
342
+ *args: Any,
343
+ throttle_time_ms: int = ...,
344
+ results: list[CreatePartitionsTopicResult] = ...,
345
+ version: int | None = None,
346
+ **kwargs: Any,
347
+ ) -> None: ...
348
+ @property
349
+ def version(self) -> int | None: ...
350
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
351
+ name: str
352
+ type: str
353
+ API_KEY: int
354
+ API_VERSION: int
355
+ valid_versions: tuple[int, int]
356
+ min_version: int
357
+ max_version: int
358
+ @property
359
+ def header(self) -> Any: ...
360
+ @classmethod
361
+ def is_request(cls) -> bool: ...
362
+ def expect_response(self) -> bool: ...
363
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
364
+
365
+ class AlterPartitionReassignmentsRequest(ApiMessage):
366
+ class ReassignableTopic(DataContainer):
367
+ class ReassignablePartition(DataContainer):
368
+ partition_index: int
369
+ replicas: list[int] | None
370
+ def __init__(
371
+ self,
372
+ *args: Any,
373
+ partition_index: int = ...,
374
+ replicas: list[int] | None = ...,
375
+ version: int | None = None,
376
+ **kwargs: Any,
377
+ ) -> None: ...
378
+ @property
379
+ def version(self) -> int | None: ...
380
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
381
+
382
+ name: str
383
+ partitions: list[ReassignablePartition]
384
+ def __init__(
385
+ self,
386
+ *args: Any,
387
+ name: str = ...,
388
+ partitions: list[ReassignablePartition] = ...,
389
+ version: int | None = None,
390
+ **kwargs: Any,
391
+ ) -> None: ...
392
+ @property
393
+ def version(self) -> int | None: ...
394
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
395
+
396
+ timeout_ms: int
397
+ allow_replication_factor_change: bool
398
+ topics: list[ReassignableTopic]
399
+ def __init__(
400
+ self,
401
+ *args: Any,
402
+ timeout_ms: int = ...,
403
+ allow_replication_factor_change: bool = ...,
404
+ topics: list[ReassignableTopic] = ...,
405
+ version: int | None = None,
406
+ **kwargs: Any,
407
+ ) -> None: ...
408
+ @property
409
+ def version(self) -> int | None: ...
410
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
411
+ name: str
412
+ type: str
413
+ API_KEY: int
414
+ API_VERSION: int
415
+ valid_versions: tuple[int, int]
416
+ min_version: int
417
+ max_version: int
418
+ @property
419
+ def header(self) -> Any: ...
420
+ @classmethod
421
+ def is_request(cls) -> bool: ...
422
+ def expect_response(self) -> bool: ...
423
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
424
+
425
+ class AlterPartitionReassignmentsResponse(ApiMessage):
426
+ class ReassignableTopicResponse(DataContainer):
427
+ class ReassignablePartitionResponse(DataContainer):
428
+ partition_index: int
429
+ error_code: int
430
+ error_message: str | None
431
+ def __init__(
432
+ self,
433
+ *args: Any,
434
+ partition_index: int = ...,
435
+ error_code: int = ...,
436
+ error_message: str | None = ...,
437
+ version: int | None = None,
438
+ **kwargs: Any,
439
+ ) -> None: ...
440
+ @property
441
+ def version(self) -> int | None: ...
442
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
443
+
444
+ name: str
445
+ partitions: list[ReassignablePartitionResponse]
446
+ def __init__(
447
+ self,
448
+ *args: Any,
449
+ name: str = ...,
450
+ partitions: list[ReassignablePartitionResponse] = ...,
451
+ version: int | None = None,
452
+ **kwargs: Any,
453
+ ) -> None: ...
454
+ @property
455
+ def version(self) -> int | None: ...
456
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
457
+
458
+ throttle_time_ms: int
459
+ allow_replication_factor_change: bool
460
+ error_code: int
461
+ error_message: str | None
462
+ responses: list[ReassignableTopicResponse]
463
+ def __init__(
464
+ self,
465
+ *args: Any,
466
+ throttle_time_ms: int = ...,
467
+ allow_replication_factor_change: bool = ...,
468
+ error_code: int = ...,
469
+ error_message: str | None = ...,
470
+ responses: list[ReassignableTopicResponse] = ...,
471
+ version: int | None = None,
472
+ **kwargs: Any,
473
+ ) -> None: ...
474
+ @property
475
+ def version(self) -> int | None: ...
476
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
477
+ name: str
478
+ type: str
479
+ API_KEY: int
480
+ API_VERSION: int
481
+ valid_versions: tuple[int, int]
482
+ min_version: int
483
+ max_version: int
484
+ @property
485
+ def header(self) -> Any: ...
486
+ @classmethod
487
+ def is_request(cls) -> bool: ...
488
+ def expect_response(self) -> bool: ...
489
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
490
+
491
+ class ListPartitionReassignmentsRequest(ApiMessage):
492
+ class ListPartitionReassignmentsTopics(DataContainer):
493
+ name: str
494
+ partition_indexes: list[int]
495
+ def __init__(
496
+ self,
497
+ *args: Any,
498
+ name: str = ...,
499
+ partition_indexes: list[int] = ...,
500
+ version: int | None = None,
501
+ **kwargs: Any,
502
+ ) -> None: ...
503
+ @property
504
+ def version(self) -> int | None: ...
505
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
506
+
507
+ timeout_ms: int
508
+ topics: list[ListPartitionReassignmentsTopics] | None
509
+ def __init__(
510
+ self,
511
+ *args: Any,
512
+ timeout_ms: int = ...,
513
+ topics: list[ListPartitionReassignmentsTopics] | None = ...,
514
+ version: int | None = None,
515
+ **kwargs: Any,
516
+ ) -> None: ...
517
+ @property
518
+ def version(self) -> int | None: ...
519
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
520
+ name: str
521
+ type: str
522
+ API_KEY: int
523
+ API_VERSION: int
524
+ valid_versions: tuple[int, int]
525
+ min_version: int
526
+ max_version: int
527
+ @property
528
+ def header(self) -> Any: ...
529
+ @classmethod
530
+ def is_request(cls) -> bool: ...
531
+ def expect_response(self) -> bool: ...
532
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
533
+
534
+ class ListPartitionReassignmentsResponse(ApiMessage):
535
+ class OngoingTopicReassignment(DataContainer):
536
+ class OngoingPartitionReassignment(DataContainer):
537
+ partition_index: int
538
+ replicas: list[int]
539
+ adding_replicas: list[int]
540
+ removing_replicas: list[int]
541
+ def __init__(
542
+ self,
543
+ *args: Any,
544
+ partition_index: int = ...,
545
+ replicas: list[int] = ...,
546
+ adding_replicas: list[int] = ...,
547
+ removing_replicas: list[int] = ...,
548
+ version: int | None = None,
549
+ **kwargs: Any,
550
+ ) -> None: ...
551
+ @property
552
+ def version(self) -> int | None: ...
553
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
554
+
555
+ name: str
556
+ partitions: list[OngoingPartitionReassignment]
557
+ def __init__(
558
+ self,
559
+ *args: Any,
560
+ name: str = ...,
561
+ partitions: list[OngoingPartitionReassignment] = ...,
562
+ version: int | None = None,
563
+ **kwargs: Any,
564
+ ) -> None: ...
565
+ @property
566
+ def version(self) -> int | None: ...
567
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
568
+
569
+ throttle_time_ms: int
570
+ error_code: int
571
+ error_message: str | None
572
+ topics: list[OngoingTopicReassignment]
573
+ def __init__(
574
+ self,
575
+ *args: Any,
576
+ throttle_time_ms: int = ...,
577
+ error_code: int = ...,
578
+ error_message: str | None = ...,
579
+ topics: list[OngoingTopicReassignment] = ...,
580
+ version: int | None = None,
581
+ **kwargs: Any,
582
+ ) -> None: ...
583
+ @property
584
+ def version(self) -> int | None: ...
585
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
586
+ name: str
587
+ type: str
588
+ API_KEY: int
589
+ API_VERSION: int
590
+ valid_versions: tuple[int, int]
591
+ min_version: int
592
+ max_version: int
593
+ @property
594
+ def header(self) -> Any: ...
595
+ @classmethod
596
+ def is_request(cls) -> bool: ...
597
+ def expect_response(self) -> bool: ...
598
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
599
+
600
+ class DescribeTopicPartitionsRequest(ApiMessage):
601
+ class TopicRequest(DataContainer):
602
+ name: str
603
+ def __init__(
604
+ self,
605
+ *args: Any,
606
+ name: str = ...,
607
+ version: int | None = None,
608
+ **kwargs: Any,
609
+ ) -> None: ...
610
+ @property
611
+ def version(self) -> int | None: ...
612
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
613
+
614
+ class Cursor(DataContainer):
615
+ topic_name: str
616
+ partition_index: int
617
+ def __init__(
618
+ self,
619
+ *args: Any,
620
+ topic_name: str = ...,
621
+ partition_index: int = ...,
622
+ version: int | None = None,
623
+ **kwargs: Any,
624
+ ) -> None: ...
625
+ @property
626
+ def version(self) -> int | None: ...
627
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
628
+
629
+ topics: list[TopicRequest]
630
+ response_partition_limit: int
631
+ cursor: Cursor | None
632
+ def __init__(
633
+ self,
634
+ *args: Any,
635
+ topics: list[TopicRequest] = ...,
636
+ response_partition_limit: int = ...,
637
+ cursor: Cursor | None = ...,
638
+ version: int | None = None,
639
+ **kwargs: Any,
640
+ ) -> None: ...
641
+ @property
642
+ def version(self) -> int | None: ...
643
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
644
+ name: str
645
+ type: str
646
+ API_KEY: int
647
+ API_VERSION: int
648
+ valid_versions: tuple[int, int]
649
+ min_version: int
650
+ max_version: int
651
+ @property
652
+ def header(self) -> Any: ...
653
+ @classmethod
654
+ def is_request(cls) -> bool: ...
655
+ def expect_response(self) -> bool: ...
656
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
657
+
658
+ class DescribeTopicPartitionsResponse(ApiMessage):
659
+ class DescribeTopicPartitionsResponseTopic(DataContainer):
660
+ class DescribeTopicPartitionsResponsePartition(DataContainer):
661
+ error_code: int
662
+ partition_index: int
663
+ leader_id: int
664
+ leader_epoch: int
665
+ replica_nodes: list[int]
666
+ isr_nodes: list[int]
667
+ eligible_leader_replicas: list[int] | None
668
+ last_known_elr: list[int] | None
669
+ offline_replicas: list[int]
670
+ def __init__(
671
+ self,
672
+ *args: Any,
673
+ error_code: int = ...,
674
+ partition_index: int = ...,
675
+ leader_id: int = ...,
676
+ leader_epoch: int = ...,
677
+ replica_nodes: list[int] = ...,
678
+ isr_nodes: list[int] = ...,
679
+ eligible_leader_replicas: list[int] | None = ...,
680
+ last_known_elr: list[int] | None = ...,
681
+ offline_replicas: list[int] = ...,
682
+ version: int | None = None,
683
+ **kwargs: Any,
684
+ ) -> None: ...
685
+ @property
686
+ def version(self) -> int | None: ...
687
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
688
+
689
+ error_code: int
690
+ name: str | None
691
+ topic_id: uuid.UUID
692
+ is_internal: bool
693
+ partitions: list[DescribeTopicPartitionsResponsePartition]
694
+ topic_authorized_operations: int
695
+ def __init__(
696
+ self,
697
+ *args: Any,
698
+ error_code: int = ...,
699
+ name: str | None = ...,
700
+ topic_id: uuid.UUID = ...,
701
+ is_internal: bool = ...,
702
+ partitions: list[DescribeTopicPartitionsResponsePartition] = ...,
703
+ topic_authorized_operations: int = ...,
704
+ version: int | None = None,
705
+ **kwargs: Any,
706
+ ) -> None: ...
707
+ @property
708
+ def version(self) -> int | None: ...
709
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
710
+
711
+ class Cursor(DataContainer):
712
+ topic_name: str
713
+ partition_index: int
714
+ def __init__(
715
+ self,
716
+ *args: Any,
717
+ topic_name: str = ...,
718
+ partition_index: int = ...,
719
+ version: int | None = None,
720
+ **kwargs: Any,
721
+ ) -> None: ...
722
+ @property
723
+ def version(self) -> int | None: ...
724
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
725
+
726
+ throttle_time_ms: int
727
+ topics: list[DescribeTopicPartitionsResponseTopic]
728
+ next_cursor: Cursor | None
729
+ def __init__(
730
+ self,
731
+ *args: Any,
732
+ throttle_time_ms: int = ...,
733
+ topics: list[DescribeTopicPartitionsResponseTopic] = ...,
734
+ next_cursor: Cursor | None = ...,
735
+ version: int | None = None,
736
+ **kwargs: Any,
737
+ ) -> None: ...
738
+ @property
739
+ def version(self) -> int | None: ...
740
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
741
+ name: str
742
+ type: str
743
+ API_KEY: int
744
+ API_VERSION: int
745
+ valid_versions: tuple[int, int]
746
+ min_version: int
747
+ max_version: int
748
+ @property
749
+ def header(self) -> Any: ...
750
+ @classmethod
751
+ def is_request(cls) -> bool: ...
752
+ def expect_response(self) -> bool: ...
753
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
754
+
755
+ class DeleteRecordsRequest(ApiMessage):
756
+ class DeleteRecordsTopic(DataContainer):
757
+ class DeleteRecordsPartition(DataContainer):
758
+ partition_index: int
759
+ offset: int
760
+ def __init__(
761
+ self,
762
+ *args: Any,
763
+ partition_index: int = ...,
764
+ offset: int = ...,
765
+ version: int | None = None,
766
+ **kwargs: Any,
767
+ ) -> None: ...
768
+ @property
769
+ def version(self) -> int | None: ...
770
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
771
+
772
+ name: str
773
+ partitions: list[DeleteRecordsPartition]
774
+ def __init__(
775
+ self,
776
+ *args: Any,
777
+ name: str = ...,
778
+ partitions: list[DeleteRecordsPartition] = ...,
779
+ version: int | None = None,
780
+ **kwargs: Any,
781
+ ) -> None: ...
782
+ @property
783
+ def version(self) -> int | None: ...
784
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
785
+
786
+ topics: list[DeleteRecordsTopic]
787
+ timeout_ms: int
788
+ def __init__(
789
+ self,
790
+ *args: Any,
791
+ topics: list[DeleteRecordsTopic] = ...,
792
+ timeout_ms: int = ...,
793
+ version: int | None = None,
794
+ **kwargs: Any,
795
+ ) -> None: ...
796
+ @property
797
+ def version(self) -> int | None: ...
798
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
799
+ name: str
800
+ type: str
801
+ API_KEY: int
802
+ API_VERSION: int
803
+ valid_versions: tuple[int, int]
804
+ min_version: int
805
+ max_version: int
806
+ @property
807
+ def header(self) -> Any: ...
808
+ @classmethod
809
+ def is_request(cls) -> bool: ...
810
+ def expect_response(self) -> bool: ...
811
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
812
+
813
+ class DeleteRecordsResponse(ApiMessage):
814
+ class DeleteRecordsTopicResult(DataContainer):
815
+ class DeleteRecordsPartitionResult(DataContainer):
816
+ partition_index: int
817
+ low_watermark: int
818
+ error_code: int
819
+ def __init__(
820
+ self,
821
+ *args: Any,
822
+ partition_index: int = ...,
823
+ low_watermark: int = ...,
824
+ error_code: int = ...,
825
+ version: int | None = None,
826
+ **kwargs: Any,
827
+ ) -> None: ...
828
+ @property
829
+ def version(self) -> int | None: ...
830
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
831
+
832
+ name: str
833
+ partitions: list[DeleteRecordsPartitionResult]
834
+ def __init__(
835
+ self,
836
+ *args: Any,
837
+ name: str = ...,
838
+ partitions: list[DeleteRecordsPartitionResult] = ...,
839
+ version: int | None = None,
840
+ **kwargs: Any,
841
+ ) -> None: ...
842
+ @property
843
+ def version(self) -> int | None: ...
844
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
845
+
846
+ throttle_time_ms: int
847
+ topics: list[DeleteRecordsTopicResult]
848
+ def __init__(
849
+ self,
850
+ *args: Any,
851
+ throttle_time_ms: int = ...,
852
+ topics: list[DeleteRecordsTopicResult] = ...,
853
+ version: int | None = None,
854
+ **kwargs: Any,
855
+ ) -> None: ...
856
+ @property
857
+ def version(self) -> int | None: ...
858
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
859
+ name: str
860
+ type: str
861
+ API_KEY: int
862
+ API_VERSION: int
863
+ valid_versions: tuple[int, int]
864
+ min_version: int
865
+ max_version: int
866
+ @property
867
+ def header(self) -> Any: ...
868
+ @classmethod
869
+ def is_request(cls) -> bool: ...
870
+ def expect_response(self) -> bool: ...
871
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
872
+
873
+ class ElectLeadersRequest(ApiMessage):
874
+ class TopicPartitions(DataContainer):
875
+ topic: str
876
+ partitions: list[int]
877
+ def __init__(
878
+ self,
879
+ *args: Any,
880
+ topic: str = ...,
881
+ partitions: list[int] = ...,
882
+ version: int | None = None,
883
+ **kwargs: Any,
884
+ ) -> None: ...
885
+ @property
886
+ def version(self) -> int | None: ...
887
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
888
+
889
+ election_type: int
890
+ topic_partitions: list[TopicPartitions] | None
891
+ timeout_ms: int
892
+ def __init__(
893
+ self,
894
+ *args: Any,
895
+ election_type: int = ...,
896
+ topic_partitions: list[TopicPartitions] | None = ...,
897
+ timeout_ms: int = ...,
898
+ version: int | None = None,
899
+ **kwargs: Any,
900
+ ) -> None: ...
901
+ @property
902
+ def version(self) -> int | None: ...
903
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
904
+ name: str
905
+ type: str
906
+ API_KEY: int
907
+ API_VERSION: int
908
+ valid_versions: tuple[int, int]
909
+ min_version: int
910
+ max_version: int
911
+ @property
912
+ def header(self) -> Any: ...
913
+ @classmethod
914
+ def is_request(cls) -> bool: ...
915
+ def expect_response(self) -> bool: ...
916
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
917
+
918
+ class ElectLeadersResponse(ApiMessage):
919
+ class ReplicaElectionResult(DataContainer):
920
+ class PartitionResult(DataContainer):
921
+ partition_id: int
922
+ error_code: int
923
+ error_message: str | None
924
+ def __init__(
925
+ self,
926
+ *args: Any,
927
+ partition_id: int = ...,
928
+ error_code: int = ...,
929
+ error_message: str | None = ...,
930
+ version: int | None = None,
931
+ **kwargs: Any,
932
+ ) -> None: ...
933
+ @property
934
+ def version(self) -> int | None: ...
935
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
936
+
937
+ topic: str
938
+ partition_result: list[PartitionResult]
939
+ def __init__(
940
+ self,
941
+ *args: Any,
942
+ topic: str = ...,
943
+ partition_result: list[PartitionResult] = ...,
944
+ version: int | None = None,
945
+ **kwargs: Any,
946
+ ) -> None: ...
947
+ @property
948
+ def version(self) -> int | None: ...
949
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
950
+
951
+ throttle_time_ms: int
952
+ error_code: int
953
+ replica_election_results: list[ReplicaElectionResult]
954
+ def __init__(
955
+ self,
956
+ *args: Any,
957
+ throttle_time_ms: int = ...,
958
+ error_code: int = ...,
959
+ replica_election_results: list[ReplicaElectionResult] = ...,
960
+ version: int | None = None,
961
+ **kwargs: Any,
962
+ ) -> None: ...
963
+ @property
964
+ def version(self) -> int | None: ...
965
+ def to_dict(self, meta: bool = False, json: bool = True) -> dict: ...
966
+ name: str
967
+ type: str
968
+ API_KEY: int
969
+ API_VERSION: int
970
+ valid_versions: tuple[int, int]
971
+ min_version: int
972
+ max_version: int
973
+ @property
974
+ def header(self) -> Any: ...
975
+ @classmethod
976
+ def is_request(cls) -> bool: ...
977
+ def expect_response(self) -> bool: ...
978
+ def with_header(self, correlation_id: int = 0, client_id: str = "kafka-python") -> None: ...
979
+
980
+ class ElectionType(IntEnum):
981
+ PREFERRED: int
982
+ UNCLEAN: int