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,1086 @@
1
+ from enum import IntEnum
2
+
3
+ from .api import Request, Response
4
+ from .types import Array, Boolean, Bytes, Int8, Int16, Int32, Int64, Schema, String, Float64, CompactString, CompactArray, TaggedFields, BitField
5
+
6
+
7
+ class CreateTopicsResponse_v0(Response):
8
+ API_KEY = 19
9
+ API_VERSION = 0
10
+ SCHEMA = Schema(
11
+ ('topics', Array(
12
+ ('name', String('utf-8')),
13
+ ('error_code', Int16)))
14
+ )
15
+ ALIASES = {
16
+ 'topic_errors': 'topics',
17
+ }
18
+
19
+
20
+ class CreateTopicsResponse_v1(Response):
21
+ API_KEY = 19
22
+ API_VERSION = 1
23
+ SCHEMA = Schema(
24
+ ('topics', Array(
25
+ ('name', String('utf-8')),
26
+ ('error_code', Int16),
27
+ ('error_message', String('utf-8'))))
28
+ )
29
+ ALIASES = CreateTopicsResponse_v0.ALIASES
30
+
31
+
32
+ class CreateTopicsResponse_v2(Response):
33
+ API_KEY = 19
34
+ API_VERSION = 2
35
+ SCHEMA = Schema(
36
+ ('throttle_time_ms', Int32),
37
+ ('topics', Array(
38
+ ('name', String('utf-8')),
39
+ ('error_code', Int16),
40
+ ('error_message', String('utf-8'))))
41
+ )
42
+ ALIASES = CreateTopicsResponse_v1.ALIASES
43
+
44
+
45
+ class CreateTopicsResponse_v3(Response):
46
+ API_KEY = 19
47
+ API_VERSION = 3
48
+ SCHEMA = CreateTopicsResponse_v2.SCHEMA
49
+ ALIASES = CreateTopicsResponse_v2.ALIASES
50
+
51
+
52
+ class CreateTopicsRequest_v0(Request):
53
+ API_KEY = 19
54
+ API_VERSION = 0
55
+ SCHEMA = Schema(
56
+ ('topics', Array(
57
+ ('name', String('utf-8')),
58
+ ('num_partitions', Int32),
59
+ ('replication_factor', Int16),
60
+ ('assignments', Array(
61
+ ('partition_index', Int32),
62
+ ('broker_ids', Array(Int32)))),
63
+ ('configs', Array(
64
+ ('name', String('utf-8')),
65
+ ('value', String('utf-8')))))),
66
+ ('timeout_ms', Int32)
67
+ )
68
+ ALIASES = {
69
+ 'create_topic_requests': 'topics',
70
+ 'timeout': 'timeout_ms',
71
+ }
72
+
73
+
74
+ class CreateTopicsRequest_v1(Request):
75
+ API_KEY = 19
76
+ API_VERSION = 1
77
+ SCHEMA = Schema(
78
+ ('topics', Array(
79
+ ('name', String('utf-8')),
80
+ ('num_partitions', Int32),
81
+ ('replication_factor', Int16),
82
+ ('assignments', Array(
83
+ ('partition_index', Int32),
84
+ ('broker_ids', Array(Int32)))),
85
+ ('configs', Array(
86
+ ('name', String('utf-8')),
87
+ ('value', String('utf-8')))))),
88
+ ('timeout_ms', Int32),
89
+ ('validate_only', Boolean)
90
+ )
91
+ ALIASES = CreateTopicsRequest_v0.ALIASES
92
+
93
+
94
+ class CreateTopicsRequest_v2(Request):
95
+ API_KEY = 19
96
+ API_VERSION = 2
97
+ SCHEMA = CreateTopicsRequest_v1.SCHEMA
98
+ ALIASES = CreateTopicsRequest_v1.ALIASES
99
+
100
+
101
+ class CreateTopicsRequest_v3(Request):
102
+ API_KEY = 19
103
+ API_VERSION = 3
104
+ SCHEMA = CreateTopicsRequest_v1.SCHEMA
105
+ ALIASES = CreateTopicsRequest_v1.ALIASES
106
+
107
+
108
+ CreateTopicsRequest = [
109
+ CreateTopicsRequest_v0, CreateTopicsRequest_v1,
110
+ CreateTopicsRequest_v2, CreateTopicsRequest_v3,
111
+ ]
112
+ CreateTopicsResponse = [
113
+ CreateTopicsResponse_v0, CreateTopicsResponse_v1,
114
+ CreateTopicsResponse_v2, CreateTopicsResponse_v3,
115
+ ]
116
+
117
+
118
+ class DeleteTopicsResponse_v0(Response):
119
+ API_KEY = 20
120
+ API_VERSION = 0
121
+ SCHEMA = Schema(
122
+ ('responses', Array(
123
+ ('name', String('utf-8')),
124
+ ('error_code', Int16)))
125
+ )
126
+ ALIASES = {
127
+ 'topic_error_codes': 'responses',
128
+ }
129
+
130
+
131
+ class DeleteTopicsResponse_v1(Response):
132
+ API_KEY = 20
133
+ API_VERSION = 1
134
+ SCHEMA = Schema(
135
+ ('throttle_time_ms', Int32),
136
+ ('responses', Array(
137
+ ('name', String('utf-8')),
138
+ ('error_code', Int16)))
139
+ )
140
+ ALIASES = DeleteTopicsResponse_v0.ALIASES
141
+
142
+
143
+ class DeleteTopicsResponse_v2(Response):
144
+ API_KEY = 20
145
+ API_VERSION = 2
146
+ SCHEMA = DeleteTopicsResponse_v1.SCHEMA
147
+ ALIASES = DeleteTopicsResponse_v1.ALIASES
148
+
149
+
150
+ class DeleteTopicsResponse_v3(Response):
151
+ API_KEY = 20
152
+ API_VERSION = 3
153
+ SCHEMA = DeleteTopicsResponse_v1.SCHEMA
154
+ ALIASES = DeleteTopicsResponse_v1.ALIASES
155
+
156
+
157
+ class DeleteTopicsRequest_v0(Request):
158
+ API_KEY = 20
159
+ API_VERSION = 0
160
+ SCHEMA = Schema(
161
+ ('topic_names', Array(String('utf-8'))),
162
+ ('timeout_ms', Int32)
163
+ )
164
+ ALIASES = {
165
+ 'topics': 'topic_names',
166
+ 'timeout': 'timeout_ms',
167
+ }
168
+
169
+
170
+ class DeleteTopicsRequest_v1(Request):
171
+ API_KEY = 20
172
+ API_VERSION = 1
173
+ SCHEMA = DeleteTopicsRequest_v0.SCHEMA
174
+ ALIASES = DeleteTopicsRequest_v0.ALIASES
175
+
176
+
177
+ class DeleteTopicsRequest_v2(Request):
178
+ API_KEY = 20
179
+ API_VERSION = 2
180
+ SCHEMA = DeleteTopicsRequest_v0.SCHEMA
181
+ ALIASES = DeleteTopicsRequest_v0.ALIASES
182
+
183
+
184
+ class DeleteTopicsRequest_v3(Request):
185
+ API_KEY = 20
186
+ API_VERSION = 3
187
+ SCHEMA = DeleteTopicsRequest_v0.SCHEMA
188
+ ALIASES = DeleteTopicsRequest_v0.ALIASES
189
+
190
+
191
+ DeleteTopicsRequest = [
192
+ DeleteTopicsRequest_v0, DeleteTopicsRequest_v1,
193
+ DeleteTopicsRequest_v2, DeleteTopicsRequest_v3,
194
+ ]
195
+ DeleteTopicsResponse = [
196
+ DeleteTopicsResponse_v0, DeleteTopicsResponse_v1,
197
+ DeleteTopicsResponse_v2, DeleteTopicsResponse_v3,
198
+ ]
199
+
200
+
201
+ class DeleteRecordsResponse_v0(Response):
202
+ API_KEY = 21
203
+ API_VERSION = 0
204
+ SCHEMA = Schema(
205
+ ('throttle_time_ms', Int32),
206
+ ('topics', Array(
207
+ ('name', String('utf-8')),
208
+ ('partitions', Array(
209
+ ('partition_index', Int32),
210
+ ('low_watermark', Int64),
211
+ ('error_code', Int16))))),
212
+ )
213
+
214
+
215
+ class DeleteRecordsRequest_v0(Request):
216
+ API_KEY = 21
217
+ API_VERSION = 0
218
+ SCHEMA = Schema(
219
+ ('topics', Array(
220
+ ('name', String('utf-8')),
221
+ ('partitions', Array(
222
+ ('partition_index', Int32),
223
+ ('offset', Int64))))),
224
+ ('timeout_ms', Int32)
225
+ )
226
+
227
+
228
+ DeleteRecordsResponse = [DeleteRecordsResponse_v0]
229
+ DeleteRecordsRequest = [DeleteRecordsRequest_v0]
230
+
231
+
232
+ class ListGroupsResponse_v0(Response):
233
+ API_KEY = 16
234
+ API_VERSION = 0
235
+ SCHEMA = Schema(
236
+ ('error_code', Int16),
237
+ ('groups', Array(
238
+ ('group_id', String('utf-8')),
239
+ ('protocol_type', String('utf-8'))))
240
+ )
241
+
242
+
243
+ class ListGroupsResponse_v1(Response):
244
+ API_KEY = 16
245
+ API_VERSION = 1
246
+ SCHEMA = Schema(
247
+ ('throttle_time_ms', Int32),
248
+ ('error_code', Int16),
249
+ ('groups', Array(
250
+ ('group_id', String('utf-8')),
251
+ ('protocol_type', String('utf-8'))))
252
+ )
253
+
254
+ class ListGroupsResponse_v2(Response):
255
+ API_KEY = 16
256
+ API_VERSION = 2
257
+ SCHEMA = ListGroupsResponse_v1.SCHEMA
258
+
259
+
260
+ class ListGroupsRequest_v0(Request):
261
+ API_KEY = 16
262
+ API_VERSION = 0
263
+ SCHEMA = Schema()
264
+
265
+
266
+ class ListGroupsRequest_v1(Request):
267
+ API_KEY = 16
268
+ API_VERSION = 1
269
+ SCHEMA = ListGroupsRequest_v0.SCHEMA
270
+
271
+ class ListGroupsRequest_v2(Request):
272
+ API_KEY = 16
273
+ API_VERSION = 1
274
+ SCHEMA = ListGroupsRequest_v0.SCHEMA
275
+
276
+
277
+ ListGroupsRequest = [
278
+ ListGroupsRequest_v0, ListGroupsRequest_v1,
279
+ ListGroupsRequest_v2,
280
+ ]
281
+ ListGroupsResponse = [
282
+ ListGroupsResponse_v0, ListGroupsResponse_v1,
283
+ ListGroupsResponse_v2,
284
+ ]
285
+
286
+
287
+ class DescribeGroupsResponse_v0(Response):
288
+ API_KEY = 15
289
+ API_VERSION = 0
290
+ SCHEMA = Schema(
291
+ ('groups', Array(
292
+ ('error_code', Int16),
293
+ ('group_id', String('utf-8')),
294
+ ('group_state', String('utf-8')),
295
+ ('protocol_type', String('utf-8')),
296
+ ('protocol_data', String('utf-8')),
297
+ ('members', Array(
298
+ ('member_id', String('utf-8')),
299
+ ('client_id', String('utf-8')),
300
+ ('client_host', String('utf-8')),
301
+ ('member_metadata', Bytes),
302
+ ('member_assignment', Bytes)))))
303
+ )
304
+
305
+
306
+ class DescribeGroupsResponse_v1(Response):
307
+ API_KEY = 15
308
+ API_VERSION = 1
309
+ SCHEMA = Schema(
310
+ ('throttle_time_ms', Int32),
311
+ ('groups', Array(
312
+ ('error_code', Int16),
313
+ ('group_id', String('utf-8')),
314
+ ('group_state', String('utf-8')),
315
+ ('protocol_type', String('utf-8')),
316
+ ('protocol_data', String('utf-8')),
317
+ ('members', Array(
318
+ ('member_id', String('utf-8')),
319
+ ('client_id', String('utf-8')),
320
+ ('client_host', String('utf-8')),
321
+ ('member_metadata', Bytes),
322
+ ('member_assignment', Bytes)))))
323
+ )
324
+
325
+
326
+ class DescribeGroupsResponse_v2(Response):
327
+ API_KEY = 15
328
+ API_VERSION = 2
329
+ SCHEMA = DescribeGroupsResponse_v1.SCHEMA
330
+
331
+
332
+ class DescribeGroupsResponse_v3(Response):
333
+ API_KEY = 15
334
+ API_VERSION = 3
335
+ SCHEMA = Schema(
336
+ ('throttle_time_ms', Int32),
337
+ ('groups', Array(
338
+ ('error_code', Int16),
339
+ ('group_id', String('utf-8')),
340
+ ('group_state', String('utf-8')),
341
+ ('protocol_type', String('utf-8')),
342
+ ('protocol_data', String('utf-8')),
343
+ ('members', Array(
344
+ ('member_id', String('utf-8')),
345
+ ('client_id', String('utf-8')),
346
+ ('client_host', String('utf-8')),
347
+ ('member_metadata', Bytes),
348
+ ('member_assignment', Bytes))),
349
+ ('authorized_operations', BitField)))
350
+ )
351
+
352
+
353
+ class DescribeGroupsRequest_v0(Request):
354
+ API_KEY = 15
355
+ API_VERSION = 0
356
+ SCHEMA = Schema(
357
+ ('groups', Array(String('utf-8')))
358
+ )
359
+
360
+
361
+ class DescribeGroupsRequest_v1(Request):
362
+ API_KEY = 15
363
+ API_VERSION = 1
364
+ SCHEMA = DescribeGroupsRequest_v0.SCHEMA
365
+
366
+
367
+ class DescribeGroupsRequest_v2(Request):
368
+ API_KEY = 15
369
+ API_VERSION = 2
370
+ SCHEMA = DescribeGroupsRequest_v0.SCHEMA
371
+
372
+
373
+ class DescribeGroupsRequest_v3(Request):
374
+ API_KEY = 15
375
+ API_VERSION = 3
376
+ SCHEMA = Schema(
377
+ ('groups', Array(String('utf-8'))),
378
+ ('include_authorized_operations', Boolean)
379
+ )
380
+
381
+
382
+ DescribeGroupsRequest = [
383
+ DescribeGroupsRequest_v0, DescribeGroupsRequest_v1,
384
+ DescribeGroupsRequest_v2, DescribeGroupsRequest_v3,
385
+ ]
386
+ DescribeGroupsResponse = [
387
+ DescribeGroupsResponse_v0, DescribeGroupsResponse_v1,
388
+ DescribeGroupsResponse_v2, DescribeGroupsResponse_v3,
389
+ ]
390
+
391
+
392
+ class DescribeAclsResponse_v0(Response):
393
+ API_KEY = 29
394
+ API_VERSION = 0
395
+ SCHEMA = Schema(
396
+ ('throttle_time_ms', Int32),
397
+ ('error_code', Int16),
398
+ ('error_message', String('utf-8')),
399
+ ('resources', Array(
400
+ ('resource_type', Int8),
401
+ ('resource_name', String('utf-8')),
402
+ ('acls', Array(
403
+ ('principal', String('utf-8')),
404
+ ('host', String('utf-8')),
405
+ ('operation', Int8),
406
+ ('permission_type', Int8)))))
407
+ )
408
+
409
+
410
+ class DescribeAclsResponse_v1(Response):
411
+ API_KEY = 29
412
+ API_VERSION = 1
413
+ SCHEMA = Schema(
414
+ ('throttle_time_ms', Int32),
415
+ ('error_code', Int16),
416
+ ('error_message', String('utf-8')),
417
+ ('resources', Array(
418
+ ('resource_type', Int8),
419
+ ('resource_name', String('utf-8')),
420
+ ('pattern_type', Int8),
421
+ ('acls', Array(
422
+ ('principal', String('utf-8')),
423
+ ('host', String('utf-8')),
424
+ ('operation', Int8),
425
+ ('permission_type', Int8)))))
426
+ )
427
+
428
+
429
+ class DescribeAclsResponse_v2(Response):
430
+ API_KEY = 29
431
+ API_VERSION = 2
432
+ SCHEMA = DescribeAclsResponse_v1.SCHEMA
433
+
434
+
435
+ class DescribeAclsRequest_v0(Request):
436
+ API_KEY = 29
437
+ API_VERSION = 0
438
+ SCHEMA = Schema(
439
+ ('resource_type_filter', Int8),
440
+ ('resource_name_filter', String('utf-8')),
441
+ ('principal_filter', String('utf-8')),
442
+ ('host_filter', String('utf-8')),
443
+ ('operation', Int8),
444
+ ('permission_type', Int8)
445
+ )
446
+ ALIASES = {
447
+ 'resource_type': 'resource_type_filter',
448
+ 'resource_name': 'resource_name_filter',
449
+ 'principal': 'principal_filter',
450
+ 'host': 'host_filter',
451
+ }
452
+
453
+
454
+ class DescribeAclsRequest_v1(Request):
455
+ API_KEY = 29
456
+ API_VERSION = 1
457
+ SCHEMA = Schema(
458
+ ('resource_type_filter', Int8),
459
+ ('resource_name_filter', String('utf-8')),
460
+ ('pattern_type_filter', Int8),
461
+ ('principal_filter', String('utf-8')),
462
+ ('host_filter', String('utf-8')),
463
+ ('operation', Int8),
464
+ ('permission_type', Int8)
465
+ )
466
+ ALIASES = {
467
+ 'resource_type': 'resource_type_filter',
468
+ 'resource_name': 'resource_name_filter',
469
+ 'resource_pattern_type_filter': 'pattern_type_filter',
470
+ 'principal': 'principal_filter',
471
+ 'host': 'host_filter',
472
+ }
473
+
474
+
475
+ class DescribeAclsRequest_v2(Request):
476
+ """
477
+ Enable flexible version
478
+ """
479
+ API_KEY = 29
480
+ API_VERSION = 2
481
+ SCHEMA = DescribeAclsRequest_v1.SCHEMA
482
+
483
+
484
+ DescribeAclsRequest = [DescribeAclsRequest_v0, DescribeAclsRequest_v1, DescribeAclsRequest_v2]
485
+ DescribeAclsResponse = [DescribeAclsResponse_v0, DescribeAclsResponse_v1, DescribeAclsResponse_v2]
486
+
487
+
488
+ class CreateAclsResponse_v0(Response):
489
+ API_KEY = 30
490
+ API_VERSION = 0
491
+ SCHEMA = Schema(
492
+ ('throttle_time_ms', Int32),
493
+ ('results', Array(
494
+ ('error_code', Int16),
495
+ ('error_message', String('utf-8'))))
496
+ )
497
+ ALIASES = {
498
+ 'creation_responses': 'results',
499
+ }
500
+
501
+
502
+ class CreateAclsResponse_v1(Response):
503
+ API_KEY = 30
504
+ API_VERSION = 1
505
+ SCHEMA = CreateAclsResponse_v0.SCHEMA
506
+ ALIASES = CreateAclsResponse_v0.ALIASES
507
+
508
+
509
+ class CreateAclsRequest_v0(Request):
510
+ API_KEY = 30
511
+ API_VERSION = 0
512
+ SCHEMA = Schema(
513
+ ('creations', Array(
514
+ ('resource_type', Int8),
515
+ ('resource_name', String('utf-8')),
516
+ ('principal', String('utf-8')),
517
+ ('host', String('utf-8')),
518
+ ('operation', Int8),
519
+ ('permission_type', Int8)))
520
+ )
521
+
522
+
523
+ class CreateAclsRequest_v1(Request):
524
+ API_KEY = 30
525
+ API_VERSION = 1
526
+ SCHEMA = Schema(
527
+ ('creations', Array(
528
+ ('resource_type', Int8),
529
+ ('resource_name', String('utf-8')),
530
+ ('resource_pattern_type', Int8),
531
+ ('principal', String('utf-8')),
532
+ ('host', String('utf-8')),
533
+ ('operation', Int8),
534
+ ('permission_type', Int8)))
535
+ )
536
+
537
+
538
+ CreateAclsRequest = [CreateAclsRequest_v0, CreateAclsRequest_v1]
539
+ CreateAclsResponse = [CreateAclsResponse_v0, CreateAclsResponse_v1]
540
+
541
+
542
+ class DeleteAclsResponse_v0(Response):
543
+ API_KEY = 31
544
+ API_VERSION = 0
545
+ SCHEMA = Schema(
546
+ ('throttle_time_ms', Int32),
547
+ ('filter_results', Array(
548
+ ('error_code', Int16),
549
+ ('error_message', String('utf-8')),
550
+ ('matching_acls', Array(
551
+ ('error_code', Int16),
552
+ ('error_message', String('utf-8')),
553
+ ('resource_type', Int8),
554
+ ('resource_name', String('utf-8')),
555
+ ('principal', String('utf-8')),
556
+ ('host', String('utf-8')),
557
+ ('operation', Int8),
558
+ ('permission_type', Int8)))))
559
+ )
560
+ ALIASES = {
561
+ 'filter_responses': 'filter_results',
562
+ }
563
+
564
+
565
+ class DeleteAclsResponse_v1(Response):
566
+ API_KEY = 31
567
+ API_VERSION = 1
568
+ SCHEMA = Schema(
569
+ ('throttle_time_ms', Int32),
570
+ ('filter_results', Array(
571
+ ('error_code', Int16),
572
+ ('error_message', String('utf-8')),
573
+ ('matching_acls', Array(
574
+ ('error_code', Int16),
575
+ ('error_message', String('utf-8')),
576
+ ('resource_type', Int8),
577
+ ('resource_name', String('utf-8')),
578
+ ('pattern_type', Int8),
579
+ ('principal', String('utf-8')),
580
+ ('host', String('utf-8')),
581
+ ('operation', Int8),
582
+ ('permission_type', Int8)))))
583
+ )
584
+ ALIASES = DeleteAclsResponse_v0.ALIASES
585
+
586
+
587
+ class DeleteAclsRequest_v0(Request):
588
+ API_KEY = 31
589
+ API_VERSION = 0
590
+ SCHEMA = Schema(
591
+ ('filters', Array(
592
+ ('resource_type_filter', Int8),
593
+ ('resource_name_filter', String('utf-8')),
594
+ ('principal_filter', String('utf-8')),
595
+ ('host_filter', String('utf-8')),
596
+ ('operation', Int8),
597
+ ('permission_type', Int8)))
598
+ )
599
+
600
+
601
+ class DeleteAclsRequest_v1(Request):
602
+ API_KEY = 31
603
+ API_VERSION = 1
604
+ SCHEMA = Schema(
605
+ ('filters', Array(
606
+ ('resource_type_filter', Int8),
607
+ ('resource_name_filter', String('utf-8')),
608
+ ('pattern_type_filter', Int8),
609
+ ('principal_filter', String('utf-8')),
610
+ ('host_filter', String('utf-8')),
611
+ ('operation', Int8),
612
+ ('permission_type', Int8)))
613
+ )
614
+
615
+
616
+ DeleteAclsRequest = [DeleteAclsRequest_v0, DeleteAclsRequest_v1]
617
+ DeleteAclsResponse = [DeleteAclsResponse_v0, DeleteAclsResponse_v1]
618
+
619
+
620
+ class AlterConfigsResponse_v0(Response):
621
+ API_KEY = 33
622
+ API_VERSION = 0
623
+ SCHEMA = Schema(
624
+ ('throttle_time_ms', Int32),
625
+ ('responses', Array(
626
+ ('error_code', Int16),
627
+ ('error_message', String('utf-8')),
628
+ ('resource_type', Int8),
629
+ ('resource_name', String('utf-8'))))
630
+ )
631
+ ALIASES = {
632
+ 'resources': 'responses',
633
+ }
634
+
635
+
636
+ class AlterConfigsResponse_v1(Response):
637
+ API_KEY = 33
638
+ API_VERSION = 1
639
+ SCHEMA = AlterConfigsResponse_v0.SCHEMA
640
+ ALIASES = AlterConfigsResponse_v0.ALIASES
641
+
642
+
643
+ class AlterConfigsRequest_v0(Request):
644
+ API_KEY = 33
645
+ API_VERSION = 0
646
+ SCHEMA = Schema(
647
+ ('resources', Array(
648
+ ('resource_type', Int8),
649
+ ('resource_name', String('utf-8')),
650
+ ('configs', Array(
651
+ ('name', String('utf-8')),
652
+ ('value', String('utf-8')))))),
653
+ ('validate_only', Boolean)
654
+ )
655
+
656
+
657
+ class AlterConfigsRequest_v1(Request):
658
+ API_KEY = 33
659
+ API_VERSION = 1
660
+ SCHEMA = AlterConfigsRequest_v0.SCHEMA
661
+
662
+
663
+ AlterConfigsRequest = [AlterConfigsRequest_v0, AlterConfigsRequest_v1]
664
+ AlterConfigsResponse = [AlterConfigsResponse_v0, AlterConfigsRequest_v1]
665
+
666
+
667
+ class DescribeConfigsResponse_v0(Response):
668
+ API_KEY = 32
669
+ API_VERSION = 0
670
+ SCHEMA = Schema(
671
+ ('throttle_time_ms', Int32),
672
+ ('results', Array(
673
+ ('error_code', Int16),
674
+ ('error_message', String('utf-8')),
675
+ ('resource_type', Int8),
676
+ ('resource_name', String('utf-8')),
677
+ ('configs', Array(
678
+ ('name', String('utf-8')),
679
+ ('value', String('utf-8')),
680
+ ('read_only', Boolean),
681
+ ('is_default', Boolean),
682
+ ('is_sensitive', Boolean)))))
683
+ )
684
+ ALIASES = {
685
+ 'resources': 'results',
686
+ }
687
+
688
+
689
+ class DescribeConfigsResponse_v1(Response):
690
+ API_KEY = 32
691
+ API_VERSION = 1
692
+ SCHEMA = Schema(
693
+ ('throttle_time_ms', Int32),
694
+ ('results', Array(
695
+ ('error_code', Int16),
696
+ ('error_message', String('utf-8')),
697
+ ('resource_type', Int8),
698
+ ('resource_name', String('utf-8')),
699
+ ('configs', Array(
700
+ ('name', String('utf-8')),
701
+ ('value', String('utf-8')),
702
+ ('read_only', Boolean),
703
+ ('config_source', Int8),
704
+ ('is_sensitive', Boolean),
705
+ ('synonyms', Array(
706
+ ('name', String('utf-8')),
707
+ ('value', String('utf-8')),
708
+ ('source', Int8)))))))
709
+ )
710
+ ALIASES = DescribeConfigsResponse_v0.ALIASES
711
+
712
+
713
+ class DescribeConfigsResponse_v2(Response):
714
+ API_KEY = 32
715
+ API_VERSION = 2
716
+ SCHEMA = DescribeConfigsResponse_v1.SCHEMA
717
+ ALIASES = DescribeConfigsResponse_v1.ALIASES
718
+
719
+
720
+ class DescribeConfigsRequest_v0(Request):
721
+ API_KEY = 32
722
+ API_VERSION = 0
723
+ SCHEMA = Schema(
724
+ ('resources', Array(
725
+ ('resource_type', Int8),
726
+ ('resource_name', String('utf-8')),
727
+ ('configuration_keys', Array(String('utf-8')))))
728
+ )
729
+
730
+ class DescribeConfigsRequest_v1(Request):
731
+ API_KEY = 32
732
+ API_VERSION = 1
733
+ SCHEMA = Schema(
734
+ ('resources', Array(
735
+ ('resource_type', Int8),
736
+ ('resource_name', String('utf-8')),
737
+ ('configuration_keys', Array(String('utf-8'))))),
738
+ ('include_synonyms', Boolean)
739
+ )
740
+
741
+
742
+ class DescribeConfigsRequest_v2(Request):
743
+ API_KEY = 32
744
+ API_VERSION = 2
745
+ SCHEMA = DescribeConfigsRequest_v1.SCHEMA
746
+
747
+
748
+ DescribeConfigsRequest = [
749
+ DescribeConfigsRequest_v0, DescribeConfigsRequest_v1,
750
+ DescribeConfigsRequest_v2,
751
+ ]
752
+ DescribeConfigsResponse = [
753
+ DescribeConfigsResponse_v0, DescribeConfigsResponse_v1,
754
+ DescribeConfigsResponse_v2,
755
+ ]
756
+
757
+
758
+ class DescribeLogDirsResponse_v0(Response):
759
+ API_KEY = 35
760
+ API_VERSION = 0
761
+ SCHEMA = Schema(
762
+ ('throttle_time_ms', Int32),
763
+ ('results', Array(
764
+ ('error_code', Int16),
765
+ ('log_dir', String('utf-8')),
766
+ ('topics', Array(
767
+ ('name', String('utf-8')),
768
+ ('partitions', Array(
769
+ ('partition_index', Int32),
770
+ ('partition_size', Int64),
771
+ ('offset_lag', Int64),
772
+ ('is_future_key', Boolean)))))))
773
+ )
774
+ ALIASES = {
775
+ 'log_dirs': 'results',
776
+ }
777
+
778
+
779
+ class DescribeLogDirsRequest_v0(Request):
780
+ API_KEY = 35
781
+ API_VERSION = 0
782
+ SCHEMA = Schema(
783
+ ('topics', Array(
784
+ ('topic', String('utf-8')),
785
+ ('partitions', Int32)))
786
+ )
787
+
788
+
789
+ DescribeLogDirsResponse = [
790
+ DescribeLogDirsResponse_v0,
791
+ ]
792
+ DescribeLogDirsRequest = [
793
+ DescribeLogDirsRequest_v0,
794
+ ]
795
+
796
+
797
+ class CreatePartitionsResponse_v0(Response):
798
+ API_KEY = 37
799
+ API_VERSION = 0
800
+ SCHEMA = Schema(
801
+ ('throttle_time_ms', Int32),
802
+ ('results', Array(
803
+ ('name', String('utf-8')),
804
+ ('error_code', Int16),
805
+ ('error_message', String('utf-8'))))
806
+ )
807
+ ALIASES = {
808
+ 'topic_errors': 'results',
809
+ }
810
+
811
+
812
+ class CreatePartitionsResponse_v1(Response):
813
+ API_KEY = 37
814
+ API_VERSION = 1
815
+ SCHEMA = CreatePartitionsResponse_v0.SCHEMA
816
+ ALIASES = CreatePartitionsResponse_v0.ALIASES
817
+
818
+
819
+ class CreatePartitionsRequest_v0(Request):
820
+ API_KEY = 37
821
+ API_VERSION = 0
822
+ SCHEMA = Schema(
823
+ ('topics', Array(
824
+ ('name', String('utf-8')),
825
+ # This is not compatible with new protocol
826
+ ('new_partitions', Schema(
827
+ ('count', Int32),
828
+ ('assignment', Array(Array(Int32))))))),
829
+ ('timeout_ms', Int32),
830
+ ('validate_only', Boolean)
831
+ )
832
+ ALIASES = {
833
+ 'topic_partitions': 'topics',
834
+ 'timeout': 'timeout_ms',
835
+ }
836
+
837
+
838
+ class CreatePartitionsRequest_v1(Request):
839
+ API_KEY = 37
840
+ API_VERSION = 1
841
+ SCHEMA = CreatePartitionsRequest_v0.SCHEMA
842
+ ALIASES = CreatePartitionsRequest_v0.ALIASES
843
+
844
+
845
+ CreatePartitionsRequest = [
846
+ CreatePartitionsRequest_v0, CreatePartitionsRequest_v1,
847
+ ]
848
+ CreatePartitionsResponse = [
849
+ CreatePartitionsResponse_v0, CreatePartitionsResponse_v1,
850
+ ]
851
+
852
+
853
+ class DeleteGroupsResponse_v0(Response):
854
+ API_KEY = 42
855
+ API_VERSION = 0
856
+ SCHEMA = Schema(
857
+ ("throttle_time_ms", Int32),
858
+ ("results", Array(
859
+ ("group_id", String("utf-8")),
860
+ ("error_code", Int16)))
861
+ )
862
+
863
+
864
+ class DeleteGroupsResponse_v1(Response):
865
+ API_KEY = 42
866
+ API_VERSION = 1
867
+ SCHEMA = DeleteGroupsResponse_v0.SCHEMA
868
+
869
+
870
+ class DeleteGroupsRequest_v0(Request):
871
+ API_KEY = 42
872
+ API_VERSION = 0
873
+ SCHEMA = Schema(
874
+ ("groups_names", Array(String("utf-8")))
875
+ )
876
+
877
+
878
+ class DeleteGroupsRequest_v1(Request):
879
+ API_KEY = 42
880
+ API_VERSION = 1
881
+ SCHEMA = DeleteGroupsRequest_v0.SCHEMA
882
+
883
+
884
+ DeleteGroupsRequest = [
885
+ DeleteGroupsRequest_v0, DeleteGroupsRequest_v1
886
+ ]
887
+ DeleteGroupsResponse = [
888
+ DeleteGroupsResponse_v0, DeleteGroupsResponse_v1
889
+ ]
890
+
891
+
892
+ # Not used by kafka.admin
893
+ class DescribeClientQuotasResponse_v0(Response):
894
+ API_KEY = 48
895
+ API_VERSION = 0
896
+ SCHEMA = Schema(
897
+ ('throttle_time_ms', Int32),
898
+ ('error_code', Int16),
899
+ ('error_message', String('utf-8')),
900
+ ('entries', Array(
901
+ ('entity', Array(
902
+ ('entity_type', String('utf-8')),
903
+ ('entity_name', String('utf-8')))),
904
+ ('values', Array(
905
+ ('key', String('utf-8')),
906
+ ('value', Float64))))),
907
+ )
908
+
909
+
910
+ class DescribeClientQuotasRequest_v0(Request):
911
+ API_KEY = 48
912
+ API_VERSION = 0
913
+ SCHEMA = Schema(
914
+ ('components', Array(
915
+ ('entity_type', String('utf-8')),
916
+ ('match_type', Int8),
917
+ ('match', String('utf-8')))),
918
+ ('strict', Boolean)
919
+ )
920
+
921
+
922
+ DescribeClientQuotasRequest = [
923
+ DescribeClientQuotasRequest_v0,
924
+ ]
925
+ DescribeClientQuotasResponse = [
926
+ DescribeClientQuotasResponse_v0,
927
+ ]
928
+
929
+
930
+ # Not used by kafka.admin
931
+ class AlterPartitionReassignmentsResponse_v0(Response):
932
+ API_KEY = 45
933
+ API_VERSION = 0
934
+ SCHEMA = Schema(
935
+ ("throttle_time_ms", Int32),
936
+ ("error_code", Int16),
937
+ ("error_message", CompactString("utf-8")),
938
+ ("responses", CompactArray(
939
+ ("name", CompactString("utf-8")),
940
+ ("partitions", CompactArray(
941
+ ("partition_index", Int32),
942
+ ("error_code", Int16),
943
+ ("error_message", CompactString("utf-8")),
944
+ ("tags", TaggedFields)
945
+ )),
946
+ ("tags", TaggedFields)
947
+ )),
948
+ ("tags", TaggedFields)
949
+ )
950
+ FLEXIBLE_VERSION = True
951
+
952
+
953
+ class AlterPartitionReassignmentsRequest_v0(Request):
954
+ FLEXIBLE_VERSION = True
955
+ API_KEY = 45
956
+ API_VERSION = 0
957
+ SCHEMA = Schema(
958
+ ("timeout_ms", Int32),
959
+ ("topics", CompactArray(
960
+ ("name", CompactString("utf-8")),
961
+ ("partitions", CompactArray(
962
+ ("partition_index", Int32),
963
+ ("replicas", CompactArray(Int32)),
964
+ ("tags", TaggedFields)
965
+ )),
966
+ ("tags", TaggedFields)
967
+ )),
968
+ ("tags", TaggedFields)
969
+ )
970
+
971
+
972
+ AlterPartitionReassignmentsRequest = [AlterPartitionReassignmentsRequest_v0]
973
+ AlterPartitionReassignmentsResponse = [AlterPartitionReassignmentsResponse_v0]
974
+
975
+
976
+ # Not used by kafka.admin
977
+ class ListPartitionReassignmentsResponse_v0(Response):
978
+ API_KEY = 46
979
+ API_VERSION = 0
980
+ SCHEMA = Schema(
981
+ ("throttle_time_ms", Int32),
982
+ ("error_code", Int16),
983
+ ("error_message", CompactString("utf-8")),
984
+ ("topics", CompactArray(
985
+ ("name", CompactString("utf-8")),
986
+ ("partitions", CompactArray(
987
+ ("partition_index", Int32),
988
+ ("replicas", CompactArray(Int32)),
989
+ ("adding_replicas", CompactArray(Int32)),
990
+ ("removing_replicas", CompactArray(Int32)),
991
+ ("tags", TaggedFields)
992
+ )),
993
+ ("tags", TaggedFields)
994
+ )),
995
+ ("tags", TaggedFields)
996
+ )
997
+ FLEXIBLE_VERSION = True
998
+
999
+
1000
+ class ListPartitionReassignmentsRequest_v0(Request):
1001
+ FLEXIBLE_VERSION = True
1002
+ API_KEY = 46
1003
+ API_VERSION = 0
1004
+ SCHEMA = Schema(
1005
+ ("timeout_ms", Int32),
1006
+ ("topics", CompactArray(
1007
+ ("name", CompactString("utf-8")),
1008
+ ("partition_indexes", CompactArray(Int32)),
1009
+ ("tags", TaggedFields)
1010
+ )),
1011
+ ("tags", TaggedFields)
1012
+ )
1013
+
1014
+
1015
+ ListPartitionReassignmentsRequest = [ListPartitionReassignmentsRequest_v0]
1016
+ ListPartitionReassignmentsResponse = [ListPartitionReassignmentsResponse_v0]
1017
+
1018
+
1019
+ class ElectLeadersResponse_v0(Response):
1020
+ API_KEY = 43
1021
+ API_VERSION = 0
1022
+ SCHEMA = Schema(
1023
+ ('throttle_time_ms', Int32),
1024
+ ('replica_election_results', Array(
1025
+ ('topic', String('utf-8')),
1026
+ ('partition_result', Array(
1027
+ ('partition_id', Int32),
1028
+ ('error_code', Int16),
1029
+ ('error_message', String('utf-8'))))))
1030
+ )
1031
+ ALIASES = {
1032
+ 'replication_election_results': 'replica_election_results',
1033
+ }
1034
+
1035
+
1036
+ class ElectLeadersResponse_v1(Response):
1037
+ API_KEY = 43
1038
+ API_VERSION = 1
1039
+ SCHEMA = Schema(
1040
+ ('throttle_time_ms', Int32),
1041
+ ('error_code', Int16),
1042
+ ('replica_election_results', Array(
1043
+ ('topic', String('utf-8')),
1044
+ ('partition_result', Array(
1045
+ ('partition_id', Int32),
1046
+ ('error_code', Int16),
1047
+ ('error_message', String('utf-8'))))))
1048
+ )
1049
+ ALIASES = ElectLeadersResponse_v0.ALIASES
1050
+
1051
+
1052
+ class ElectLeadersRequest_v0(Request):
1053
+ API_KEY = 43
1054
+ API_VERSION = 0
1055
+ SCHEMA = Schema(
1056
+ ('topic_partitions', Array(
1057
+ ('topic', String('utf-8')),
1058
+ ('partitions', Array(Int32)))),
1059
+ ('timeout_ms', Int32),
1060
+ )
1061
+ ALIASES = {
1062
+ 'timeout': 'timeout_ms',
1063
+ }
1064
+
1065
+
1066
+ class ElectLeadersRequest_v1(Request):
1067
+ API_KEY = 43
1068
+ API_VERSION = 1
1069
+ SCHEMA = Schema(
1070
+ ('election_type', Int8),
1071
+ ('topic_partitions', Array(
1072
+ ('topic', String('utf-8')),
1073
+ ('partitions', Array(Int32)))),
1074
+ ('timeout_ms', Int32),
1075
+ )
1076
+ ALIASES = ElectLeadersRequest_v0.ALIASES
1077
+
1078
+
1079
+ class ElectionType(IntEnum):
1080
+ """Leader election type"""
1081
+ PREFERRED = 0,
1082
+ UNCLEAN = 1
1083
+
1084
+
1085
+ ElectLeadersRequest = [ElectLeadersRequest_v0, ElectLeadersRequest_v1]
1086
+ ElectLeadersResponse = [ElectLeadersResponse_v0, ElectLeadersResponse_v1]