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,30 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 50,
18
+ "type": "request",
19
+ "listeners": ["broker", "controller"],
20
+ "name": "DescribeUserScramCredentialsRequest",
21
+ "validVersions": "0",
22
+ "flexibleVersions": "0+",
23
+ "fields": [
24
+ { "name": "Users", "type": "[]UserName", "versions": "0+", "nullableVersions": "0+",
25
+ "about": "The users to describe, or null/empty to describe all users.", "fields": [
26
+ { "name": "Name", "type": "string", "versions": "0+",
27
+ "about": "The user name." }
28
+ ]}
29
+ ]
30
+ }
@@ -0,0 +1,45 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 50,
18
+ "type": "response",
19
+ "name": "DescribeUserScramCredentialsResponse",
20
+ "validVersions": "0",
21
+ "flexibleVersions": "0+",
22
+ "fields": [
23
+ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
24
+ "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
25
+ { "name": "ErrorCode", "type": "int16", "versions": "0+",
26
+ "about": "The message-level error code, 0 except for user authorization or infrastructure issues." },
27
+ { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+",
28
+ "about": "The message-level error message, if any." },
29
+ { "name": "Results", "type": "[]DescribeUserScramCredentialsResult", "versions": "0+",
30
+ "about": "The results for descriptions, one per user.", "fields": [
31
+ { "name": "User", "type": "string", "versions": "0+",
32
+ "about": "The user name." },
33
+ { "name": "ErrorCode", "type": "int16", "versions": "0+",
34
+ "about": "The user-level error code." },
35
+ { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+",
36
+ "about": "The user-level error message, if any." },
37
+ { "name": "CredentialInfos", "type": "[]CredentialInfo", "versions": "0+",
38
+ "about": "The mechanism and related information associated with the user's SCRAM credentials.", "fields": [
39
+ { "name": "Mechanism", "type": "int8", "versions": "0+",
40
+ "about": "The SCRAM mechanism." },
41
+ { "name": "Iterations", "type": "int32", "versions": "0+",
42
+ "about": "The number of iterations used in the SCRAM credential." }]}
43
+ ]}
44
+ ]
45
+ }
@@ -0,0 +1,41 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 43,
18
+ "type": "request",
19
+ "listeners": ["broker", "controller"],
20
+ "name": "ElectLeadersRequest",
21
+ // Version 1 implements multiple leader election types, as described by KIP-460.
22
+ //
23
+ // Version 2 is the first flexible version.
24
+ "validVersions": "0-2",
25
+ "flexibleVersions": "2+",
26
+ "fields": [
27
+ { "name": "ElectionType", "type": "int8", "versions": "1+",
28
+ "about": "Type of elections to conduct for the partition. A value of '0' elects the preferred replica. A value of '1' elects the first live replica if there are no in-sync replica." },
29
+ { "name": "TopicPartitions", "type": "[]TopicPartitions", "versions": "0+", "nullableVersions": "0+",
30
+ "about": "The topic partitions to elect leaders.",
31
+ "fields": [
32
+ { "name": "Topic", "type": "string", "versions": "0+", "entityType": "topicName", "mapKey": true,
33
+ "about": "The name of a topic." },
34
+ { "name": "Partitions", "type": "[]int32", "versions": "0+",
35
+ "about": "The partitions of this topic whose leader should be elected." }
36
+ ]
37
+ },
38
+ { "name": "TimeoutMs", "type": "int32", "versions": "0+", "default": "60000",
39
+ "about": "The time in ms to wait for the election to complete." }
40
+ ]
41
+ }
@@ -0,0 +1,45 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 43,
18
+ "type": "response",
19
+ "name": "ElectLeadersResponse",
20
+ // Version 1 adds a top-level error code.
21
+ //
22
+ // Version 2 is the first flexible version.
23
+ "validVersions": "0-2",
24
+ "flexibleVersions": "2+",
25
+ "fields": [
26
+ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
27
+ "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
28
+ { "name": "ErrorCode", "type": "int16", "versions": "1+", "ignorable": false,
29
+ "about": "The top level response error code." },
30
+ { "name": "ReplicaElectionResults", "type": "[]ReplicaElectionResult", "versions": "0+",
31
+ "about": "The election results, or an empty array if the requester did not have permission and the request asks for all partitions.", "fields": [
32
+ { "name": "Topic", "type": "string", "versions": "0+", "entityType": "topicName",
33
+ "about": "The topic name." },
34
+ { "name": "PartitionResult", "type": "[]PartitionResult", "versions": "0+",
35
+ "about": "The results for each partition.", "fields": [
36
+ { "name": "PartitionId", "type": "int32", "versions": "0+",
37
+ "about": "The partition id." },
38
+ { "name": "ErrorCode", "type": "int16", "versions": "0+",
39
+ "about": "The result error, or zero if there was no error."},
40
+ { "name": "ErrorMessage", "type": "string", "versions": "0+", "nullableVersions": "0+",
41
+ "about": "The result message, or null if there was no error."}
42
+ ]}
43
+ ]}
44
+ ]
45
+ }
@@ -0,0 +1,43 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 26,
18
+ "type": "request",
19
+ "listeners": ["broker"],
20
+ "name": "EndTxnRequest",
21
+ // Version 1 is the same as version 0.
22
+ //
23
+ // Version 2 adds the support for new error code PRODUCER_FENCED.
24
+ //
25
+ // Version 3 enables flexible versions.
26
+ //
27
+ // Version 4 adds support for new error code TRANSACTION_ABORTABLE (KIP-890).
28
+ //
29
+ // Version 5 enables bumping epoch on every transaction (KIP-890 Part 2)
30
+ "latestVersionUnstable": false,
31
+ "validVersions": "0-5",
32
+ "flexibleVersions": "3+",
33
+ "fields": [
34
+ { "name": "TransactionalId", "type": "string", "versions": "0+", "entityType": "transactionalId",
35
+ "about": "The ID of the transaction to end." },
36
+ { "name": "ProducerId", "type": "int64", "versions": "0+", "entityType": "producerId",
37
+ "about": "The producer ID." },
38
+ { "name": "ProducerEpoch", "type": "int16", "versions": "0+",
39
+ "about": "The current epoch associated with the producer." },
40
+ { "name": "Committed", "type": "bool", "versions": "0+",
41
+ "about": "True if the transaction was committed, false if it was aborted." }
42
+ ]
43
+ }
@@ -0,0 +1,41 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 26,
18
+ "type": "response",
19
+ "name": "EndTxnResponse",
20
+ // Starting in version 1, on quota violation, brokers send out responses before throttling.
21
+ //
22
+ // Version 2 adds the support for new error code PRODUCER_FENCED.
23
+ //
24
+ // Version 3 enables flexible versions.
25
+ //
26
+ // Version 4 adds support for new error code TRANSACTION_ABORTABLE (KIP-890).
27
+ //
28
+ // Version 5 enables bumping epoch on every transaction (KIP-890 Part 2), so producer ID and epoch are included in the response.
29
+ "validVersions": "0-5",
30
+ "flexibleVersions": "3+",
31
+ "fields": [
32
+ { "name": "ThrottleTimeMs", "type": "int32", "versions": "0+",
33
+ "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
34
+ { "name": "ErrorCode", "type": "int16", "versions": "0+",
35
+ "about": "The error code, or 0 if there was no error." },
36
+ { "name": "ProducerId", "type": "int64", "versions": "5+", "entityType": "producerId", "default": "-1", "ignorable": true,
37
+ "about": "The producer ID." },
38
+ { "name": "ProducerEpoch", "type": "int16", "versions": "5+", "default": "-1", "ignorable": true,
39
+ "about": "The current epoch associated with the producer." }
40
+ ]
41
+ }
@@ -0,0 +1,125 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 1,
18
+ "type": "request",
19
+ "listeners": ["broker", "controller"],
20
+ "name": "FetchRequest",
21
+ // Versions 0-3 were removed in Apache Kafka 4.0, Version 4 is the new baseline.
22
+ //
23
+ // Version 1 is the same as version 0.
24
+ // Starting in Version 2, the requester must be able to handle Kafka Log
25
+ // Message format version 1.
26
+ // Version 3 adds MaxBytes. Starting in version 3, the partition ordering in
27
+ // the request is now relevant. Partitions will be processed in the order
28
+ // they appear in the request.
29
+ //
30
+ // Version 4 adds IsolationLevel. Starting in version 4, the requestor must be
31
+ // able to handle Kafka log message format version 2.
32
+ //
33
+ // Version 5 adds LogStartOffset to indicate the earliest available offset of
34
+ // partition data that can be consumed.
35
+ //
36
+ // Version 6 is the same as version 5.
37
+ //
38
+ // Version 7 adds incremental fetch request support.
39
+ //
40
+ // Version 8 is the same as version 7.
41
+ //
42
+ // Version 9 adds CurrentLeaderEpoch, as described in KIP-320.
43
+ //
44
+ // Version 10 indicates that we can use the ZStd compression algorithm, as
45
+ // described in KIP-110.
46
+ // Version 12 adds flexible versions support as well as epoch validation through
47
+ // the `LastFetchedEpoch` field
48
+ //
49
+ // Version 13 replaces topic names with topic IDs (KIP-516). May return UNKNOWN_TOPIC_ID error code.
50
+ //
51
+ // Version 14 is the same as version 13 but it also receives a new error called OffsetMovedToTieredStorageException(KIP-405)
52
+ //
53
+ // Version 15 adds the ReplicaState which includes new field ReplicaEpoch and the ReplicaId. Also,
54
+ // deprecate the old ReplicaId field and set its default value to -1. (KIP-903)
55
+ //
56
+ // Version 16 is the same as version 15 (KIP-951).
57
+ //
58
+ // Version 17 adds directory id support from KIP-853
59
+ //
60
+ // Version 18 adds high-watermark from KIP-1166
61
+ "validVersions": "4-18",
62
+ "flexibleVersions": "12+",
63
+ "fields": [
64
+ { "name": "ClusterId", "type": "string", "versions": "12+", "nullableVersions": "12+", "default": "null",
65
+ "taggedVersions": "12+", "tag": 0, "ignorable": true,
66
+ "about": "The clusterId if known. This is used to validate metadata fetches prior to broker registration." },
67
+ { "name": "ReplicaId", "type": "int32", "versions": "0-14", "default": "-1", "entityType": "brokerId",
68
+ "about": "The broker ID of the follower, of -1 if this request is from a consumer." },
69
+ { "name": "ReplicaState", "type": "ReplicaState", "versions": "15+", "taggedVersions": "15+", "tag": 1,
70
+ "about": "The state of the replica in the follower.", "fields": [
71
+ { "name": "ReplicaId", "type": "int32", "versions": "15+", "default": "-1", "entityType": "brokerId",
72
+ "about": "The replica ID of the follower, or -1 if this request is from a consumer." },
73
+ { "name": "ReplicaEpoch", "type": "int64", "versions": "15+", "default": "-1",
74
+ "about": "The epoch of this follower, or -1 if not available." }
75
+ ]},
76
+ { "name": "MaxWaitMs", "type": "int32", "versions": "0+",
77
+ "about": "The maximum time in milliseconds to wait for the response." },
78
+ { "name": "MinBytes", "type": "int32", "versions": "0+",
79
+ "about": "The minimum bytes to accumulate in the response." },
80
+ { "name": "MaxBytes", "type": "int32", "versions": "3+", "default": "0x7fffffff", "ignorable": true,
81
+ "about": "The maximum bytes to fetch. See KIP-74 for cases where this limit may not be honored." },
82
+ { "name": "IsolationLevel", "type": "int8", "versions": "4+", "default": "0", "ignorable": true,
83
+ "about": "This setting controls the visibility of transactional records. Using READ_UNCOMMITTED (isolation_level = 0) makes all records visible. With READ_COMMITTED (isolation_level = 1), non-transactional and COMMITTED transactional records are visible. To be more concrete, READ_COMMITTED returns all data from offsets smaller than the current LSO (last stable offset), and enables the inclusion of the list of aborted transactions in the result, which allows consumers to discard ABORTED transactional records." },
84
+ { "name": "SessionId", "type": "int32", "versions": "7+", "default": "0", "ignorable": true,
85
+ "about": "The fetch session ID." },
86
+ { "name": "SessionEpoch", "type": "int32", "versions": "7+", "default": "-1", "ignorable": true,
87
+ "about": "The fetch session epoch, which is used for ordering requests in a session." },
88
+ { "name": "Topics", "type": "[]FetchTopic", "versions": "0+",
89
+ "about": "The topics to fetch.", "fields": [
90
+ { "name": "Topic", "type": "string", "versions": "0-12", "entityType": "topicName", "ignorable": true,
91
+ "about": "The name of the topic to fetch." },
92
+ { "name": "TopicId", "type": "uuid", "versions": "13+", "ignorable": true, "about": "The unique topic ID."},
93
+ { "name": "Partitions", "type": "[]FetchPartition", "versions": "0+",
94
+ "about": "The partitions to fetch.", "fields": [
95
+ { "name": "Partition", "type": "int32", "versions": "0+",
96
+ "about": "The partition index." },
97
+ { "name": "CurrentLeaderEpoch", "type": "int32", "versions": "9+", "default": "-1", "ignorable": true,
98
+ "about": "The current leader epoch of the partition." },
99
+ { "name": "FetchOffset", "type": "int64", "versions": "0+",
100
+ "about": "The message offset." },
101
+ { "name": "LastFetchedEpoch", "type": "int32", "versions": "12+", "default": "-1", "ignorable": false,
102
+ "about": "The epoch of the last fetched record or -1 if there is none."},
103
+ { "name": "LogStartOffset", "type": "int64", "versions": "5+", "default": "-1", "ignorable": true,
104
+ "about": "The earliest available offset of the follower replica. The field is only used when the request is sent by the follower."},
105
+ { "name": "PartitionMaxBytes", "type": "int32", "versions": "0+",
106
+ "about": "The maximum bytes to fetch from this partition. See KIP-74 for cases where this limit may not be honored." },
107
+ { "name": "ReplicaDirectoryId", "type": "uuid", "versions": "17+", "taggedVersions": "17+", "tag": 0, "ignorable": true,
108
+ "about": "The directory id of the follower fetching." },
109
+ { "name": "HighWatermark", "type": "int64", "versions": "18+", "default": "9223372036854775807", "taggedVersions": "18+",
110
+ "tag": 1, "ignorable": true,
111
+ "about": "The high-watermark known by the replica. -1 if the high-watermark is not known and 9223372036854775807 if the feature is not supported." }
112
+ ]}
113
+ ]},
114
+ { "name": "ForgottenTopicsData", "type": "[]ForgottenTopic", "versions": "7+", "ignorable": false,
115
+ "about": "In an incremental fetch request, the partitions to remove.", "fields": [
116
+ { "name": "Topic", "type": "string", "versions": "7-12", "entityType": "topicName", "ignorable": true,
117
+ "about": "The topic name." },
118
+ { "name": "TopicId", "type": "uuid", "versions": "13+", "ignorable": true, "about": "The unique topic ID."},
119
+ { "name": "Partitions", "type": "[]int32", "versions": "7+",
120
+ "about": "The partitions indexes to forget." }
121
+ ]},
122
+ { "name": "RackId", "type": "string", "versions": "11+", "default": "", "ignorable": true,
123
+ "about": "Rack ID of the consumer making this request."}
124
+ ]
125
+ }
@@ -0,0 +1,124 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 1,
18
+ "type": "response",
19
+ "name": "FetchResponse",
20
+ // Versions 0-3 were removed in Apache Kafka 4.0, Version 4 is the new baseline.
21
+ //
22
+ // Version 1 adds throttle time. Version 2 and 3 are the same as version 1.
23
+ //
24
+ // Version 4 adds features for transactional consumption.
25
+ //
26
+ // Version 5 adds LogStartOffset to indicate the earliest available offset of
27
+ // partition data that can be consumed.
28
+ //
29
+ // Starting in version 6, we may return KAFKA_STORAGE_ERROR as an error code.
30
+ //
31
+ // Version 7 adds incremental fetch request support.
32
+ //
33
+ // Starting in version 8, on quota violation, brokers send out responses before throttling.
34
+ //
35
+ // Version 9 is the same as version 8.
36
+ //
37
+ // Version 10 indicates that the response data can use the ZStd compression
38
+ // algorithm, as described in KIP-110.
39
+ // Version 12 adds support for flexible versions, epoch detection through the `TruncationOffset` field,
40
+ // and leader discovery through the `CurrentLeader` field
41
+ //
42
+ // Version 13 replaces the topic name field with topic ID (KIP-516).
43
+ //
44
+ // Version 14 is the same as version 13 but it also receives a new error called OffsetMovedToTieredStorageException (KIP-405)
45
+ //
46
+ // Version 15 is the same as version 14 (KIP-903).
47
+ //
48
+ // Version 16 adds the 'NodeEndpoints' field (KIP-951).
49
+ //
50
+ // Version 17 no changes to the response (KIP-853).
51
+ //
52
+ // Version 18 no changes to the response (KIP-1166)
53
+ "validVersions": "4-18",
54
+ "flexibleVersions": "12+",
55
+ "fields": [
56
+ { "name": "ThrottleTimeMs", "type": "int32", "versions": "1+", "ignorable": true,
57
+ "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
58
+ { "name": "ErrorCode", "type": "int16", "versions": "7+", "ignorable": true,
59
+ "about": "The top level response error code." },
60
+ { "name": "SessionId", "type": "int32", "versions": "7+", "default": "0", "ignorable": false,
61
+ "about": "The fetch session ID, or 0 if this is not part of a fetch session." },
62
+ { "name": "Responses", "type": "[]FetchableTopicResponse", "versions": "0+",
63
+ "about": "The response topics.", "fields": [
64
+ { "name": "Topic", "type": "string", "versions": "0-12", "ignorable": true, "entityType": "topicName",
65
+ "about": "The topic name." },
66
+ { "name": "TopicId", "type": "uuid", "versions": "13+", "ignorable": true, "about": "The unique topic ID."},
67
+ { "name": "Partitions", "type": "[]PartitionData", "versions": "0+",
68
+ "about": "The topic partitions.", "fields": [
69
+ { "name": "PartitionIndex", "type": "int32", "versions": "0+",
70
+ "about": "The partition index." },
71
+ { "name": "ErrorCode", "type": "int16", "versions": "0+",
72
+ "about": "The error code, or 0 if there was no fetch error." },
73
+ { "name": "HighWatermark", "type": "int64", "versions": "0+",
74
+ "about": "The current high water mark." },
75
+ { "name": "LastStableOffset", "type": "int64", "versions": "4+", "default": "-1", "ignorable": true,
76
+ "about": "The last stable offset (or LSO) of the partition. This is the last offset such that the state of all transactional records prior to this offset have been decided (ABORTED or COMMITTED)." },
77
+ { "name": "LogStartOffset", "type": "int64", "versions": "5+", "default": "-1", "ignorable": true,
78
+ "about": "The current log start offset." },
79
+ { "name": "DivergingEpoch", "type": "EpochEndOffset", "versions": "12+", "taggedVersions": "12+", "tag": 0,
80
+ "about": "In case divergence is detected based on the `LastFetchedEpoch` and `FetchOffset` in the request, this field indicates the largest epoch and its end offset such that subsequent records are known to diverge.", "fields": [
81
+ { "name": "Epoch", "type": "int32", "versions": "12+", "default": "-1",
82
+ "about": "The largest epoch." },
83
+ { "name": "EndOffset", "type": "int64", "versions": "12+", "default": "-1",
84
+ "about": "The end offset of the epoch." }
85
+ ]},
86
+ { "name": "CurrentLeader", "type": "LeaderIdAndEpoch",
87
+ "versions": "12+", "taggedVersions": "12+", "tag": 1,
88
+ "about": "The current leader of the partition.", "fields": [
89
+ { "name": "LeaderId", "type": "int32", "versions": "12+", "default": "-1", "entityType": "brokerId",
90
+ "about": "The ID of the current leader or -1 if the leader is unknown."},
91
+ { "name": "LeaderEpoch", "type": "int32", "versions": "12+", "default": "-1",
92
+ "about": "The latest known leader epoch." }
93
+ ]},
94
+ { "name": "SnapshotId", "type": "SnapshotId",
95
+ "versions": "12+", "taggedVersions": "12+", "tag": 2,
96
+ "about": "In the case of fetching an offset less than the LogStartOffset, this is the end offset and epoch that should be used in the FetchSnapshot request.", "fields": [
97
+ { "name": "EndOffset", "type": "int64", "versions": "0+", "default": "-1",
98
+ "about": "The end offset of the epoch." },
99
+ { "name": "Epoch", "type": "int32", "versions": "0+", "default": "-1",
100
+ "about": "The largest epoch." }
101
+ ]},
102
+ { "name": "AbortedTransactions", "type": "[]AbortedTransaction", "versions": "4+", "nullableVersions": "4+", "ignorable": true,
103
+ "about": "The aborted transactions.", "fields": [
104
+ { "name": "ProducerId", "type": "int64", "versions": "4+", "entityType": "producerId",
105
+ "about": "The producer id associated with the aborted transaction." },
106
+ { "name": "FirstOffset", "type": "int64", "versions": "4+",
107
+ "about": "The first offset in the aborted transaction." }
108
+ ]},
109
+ { "name": "PreferredReadReplica", "type": "int32", "versions": "11+", "default": "-1", "ignorable": false, "entityType": "brokerId",
110
+ "about": "The preferred read replica for the consumer to use on its next fetch request."},
111
+ { "name": "Records", "type": "records", "versions": "0+", "nullableVersions": "0+", "about": "The record data."}
112
+ ]}
113
+ ]},
114
+ { "name": "NodeEndpoints", "type": "[]NodeEndpoint", "versions": "16+", "taggedVersions": "16+", "tag": 0,
115
+ "about": "Endpoints for all current-leaders enumerated in PartitionData, with errors NOT_LEADER_OR_FOLLOWER & FENCED_LEADER_EPOCH.", "fields": [
116
+ { "name": "NodeId", "type": "int32", "versions": "16+",
117
+ "mapKey": true, "entityType": "brokerId", "about": "The ID of the associated node."},
118
+ { "name": "Host", "type": "string", "versions": "16+", "about": "The node's hostname." },
119
+ { "name": "Port", "type": "int32", "versions": "16+", "about": "The node's port." },
120
+ { "name": "Rack", "type": "string", "versions": "16+", "nullableVersions": "16+", "default": "null",
121
+ "about": "The rack of the node, or null if it has not been assigned to a rack." }
122
+ ]}
123
+ ]
124
+ }
@@ -0,0 +1,43 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 10,
18
+ "type": "request",
19
+ "listeners": ["broker"],
20
+ "name": "FindCoordinatorRequest",
21
+ // Version 1 adds KeyType.
22
+ //
23
+ // Version 2 is the same as version 1.
24
+ //
25
+ // Version 3 is the first flexible version.
26
+ //
27
+ // Version 4 adds support for batching via CoordinatorKeys (KIP-699)
28
+ //
29
+ // Version 5 adds support for new error code TRANSACTION_ABORTABLE (KIP-890).
30
+ //
31
+ // Version 6 adds support for share groups (KIP-932).
32
+ // For key type SHARE (2), the coordinator key format is "groupId:topicId:partition".
33
+ "validVersions": "0-6",
34
+ "flexibleVersions": "3+",
35
+ "fields": [
36
+ { "name": "Key", "type": "string", "versions": "0-3",
37
+ "about": "The coordinator key." },
38
+ { "name": "KeyType", "type": "int8", "versions": "1+", "default": "0", "ignorable": false,
39
+ "about": "The coordinator key type. (group, transaction, share)." },
40
+ { "name": "CoordinatorKeys", "type": "[]string", "versions": "4+",
41
+ "about": "The coordinator keys." }
42
+ ]
43
+ }
@@ -0,0 +1,58 @@
1
+ // Licensed to the Apache Software Foundation (ASF) under one or more
2
+ // contributor license agreements. See the NOTICE file distributed with
3
+ // this work for additional information regarding copyright ownership.
4
+ // The ASF licenses this file to You under the Apache License, Version 2.0
5
+ // (the "License"); you may not use this file except in compliance with
6
+ // the License. You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ {
17
+ "apiKey": 10,
18
+ "type": "response",
19
+ "name": "FindCoordinatorResponse",
20
+ // Version 1 adds throttle time and error messages.
21
+ //
22
+ // Starting in version 2, on quota violation, brokers send out responses before throttling.
23
+ //
24
+ // Version 3 is the first flexible version.
25
+ //
26
+ // Version 4 adds support for batching via Coordinators (KIP-699)
27
+ //
28
+ // Version 5 adds support for new error code TRANSACTION_ABORTABLE (KIP-890).
29
+ //
30
+ // Version 6 adds support for share groups (KIP-932).
31
+ "validVersions": "0-6",
32
+ "flexibleVersions": "3+",
33
+ "fields": [
34
+ { "name": "ThrottleTimeMs", "type": "int32", "versions": "1+", "ignorable": true,
35
+ "about": "The duration in milliseconds for which the request was throttled due to a quota violation, or zero if the request did not violate any quota." },
36
+ { "name": "ErrorCode", "type": "int16", "versions": "0-3",
37
+ "about": "The error code, or 0 if there was no error." },
38
+ { "name": "ErrorMessage", "type": "string", "versions": "1-3", "nullableVersions": "1-3", "ignorable": true,
39
+ "about": "The error message, or null if there was no error." },
40
+ { "name": "NodeId", "type": "int32", "versions": "0-3", "entityType": "brokerId",
41
+ "about": "The node id." },
42
+ { "name": "Host", "type": "string", "versions": "0-3",
43
+ "about": "The host name." },
44
+ { "name": "Port", "type": "int32", "versions": "0-3",
45
+ "about": "The port." },
46
+ { "name": "Coordinators", "type": "[]Coordinator", "versions": "4+", "about": "Each coordinator result in the response.", "fields": [
47
+ { "name": "Key", "type": "string", "versions": "4+", "about": "The coordinator key." },
48
+ { "name": "NodeId", "type": "int32", "versions": "4+", "entityType": "brokerId",
49
+ "about": "The node id." },
50
+ { "name": "Host", "type": "string", "versions": "4+", "about": "The host name." },
51
+ { "name": "Port", "type": "int32", "versions": "4+", "about": "The port." },
52
+ { "name": "ErrorCode", "type": "int16", "versions": "4+",
53
+ "about": "The error code, or 0 if there was no error." },
54
+ { "name": "ErrorMessage", "type": "string", "versions": "4+", "nullableVersions": "4+", "ignorable": true,
55
+ "about": "The error message, or null if there was no error." }
56
+ ]}
57
+ ]
58
+ }