@point3/node-rdkafka 3.6.0-1

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 (707) hide show
  1. package/LICENSE.txt +20 -0
  2. package/README.md +636 -0
  3. package/binding.gyp +154 -0
  4. package/deps/librdkafka/.clang-format +136 -0
  5. package/deps/librdkafka/.clang-format-cpp +103 -0
  6. package/deps/librdkafka/.dir-locals.el +10 -0
  7. package/deps/librdkafka/.formatignore +33 -0
  8. package/deps/librdkafka/.gdbmacros +19 -0
  9. package/deps/librdkafka/.github/CODEOWNERS +1 -0
  10. package/deps/librdkafka/.github/ISSUE_TEMPLATE +34 -0
  11. package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
  12. package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
  13. package/deps/librdkafka/.semaphore/semaphore.yml +378 -0
  14. package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
  15. package/deps/librdkafka/CHANGELOG.md +2208 -0
  16. package/deps/librdkafka/CMakeLists.txt +291 -0
  17. package/deps/librdkafka/CODE_OF_CONDUCT.md +46 -0
  18. package/deps/librdkafka/CONFIGURATION.md +209 -0
  19. package/deps/librdkafka/CONTRIBUTING.md +431 -0
  20. package/deps/librdkafka/Doxyfile +2375 -0
  21. package/deps/librdkafka/INTRODUCTION.md +2481 -0
  22. package/deps/librdkafka/LICENSE +26 -0
  23. package/deps/librdkafka/LICENSE.cjson +22 -0
  24. package/deps/librdkafka/LICENSE.crc32c +28 -0
  25. package/deps/librdkafka/LICENSE.fnv1a +18 -0
  26. package/deps/librdkafka/LICENSE.hdrhistogram +27 -0
  27. package/deps/librdkafka/LICENSE.lz4 +26 -0
  28. package/deps/librdkafka/LICENSE.murmur2 +25 -0
  29. package/deps/librdkafka/LICENSE.nanopb +22 -0
  30. package/deps/librdkafka/LICENSE.opentelemetry +203 -0
  31. package/deps/librdkafka/LICENSE.pycrc +23 -0
  32. package/deps/librdkafka/LICENSE.queue +31 -0
  33. package/deps/librdkafka/LICENSE.regexp +5 -0
  34. package/deps/librdkafka/LICENSE.snappy +36 -0
  35. package/deps/librdkafka/LICENSE.tinycthread +26 -0
  36. package/deps/librdkafka/LICENSE.wingetopt +49 -0
  37. package/deps/librdkafka/LICENSES.txt +625 -0
  38. package/deps/librdkafka/Makefile +125 -0
  39. package/deps/librdkafka/README.md +199 -0
  40. package/deps/librdkafka/README.win32 +26 -0
  41. package/deps/librdkafka/STATISTICS.md +624 -0
  42. package/deps/librdkafka/configure +214 -0
  43. package/deps/librdkafka/configure.self +331 -0
  44. package/deps/librdkafka/debian/changelog +111 -0
  45. package/deps/librdkafka/debian/compat +1 -0
  46. package/deps/librdkafka/debian/control +71 -0
  47. package/deps/librdkafka/debian/copyright +99 -0
  48. package/deps/librdkafka/debian/gbp.conf +9 -0
  49. package/deps/librdkafka/debian/librdkafka++1.install +1 -0
  50. package/deps/librdkafka/debian/librdkafka-dev.examples +2 -0
  51. package/deps/librdkafka/debian/librdkafka-dev.install +9 -0
  52. package/deps/librdkafka/debian/librdkafka1.docs +5 -0
  53. package/deps/librdkafka/debian/librdkafka1.install +1 -0
  54. package/deps/librdkafka/debian/librdkafka1.symbols +135 -0
  55. package/deps/librdkafka/debian/rules +19 -0
  56. package/deps/librdkafka/debian/source/format +1 -0
  57. package/deps/librdkafka/debian/watch +2 -0
  58. package/deps/librdkafka/dev-conf.sh +123 -0
  59. package/deps/librdkafka/examples/CMakeLists.txt +79 -0
  60. package/deps/librdkafka/examples/Makefile +167 -0
  61. package/deps/librdkafka/examples/README.md +42 -0
  62. package/deps/librdkafka/examples/alter_consumer_group_offsets.c +338 -0
  63. package/deps/librdkafka/examples/consumer.c +271 -0
  64. package/deps/librdkafka/examples/delete_records.c +233 -0
  65. package/deps/librdkafka/examples/describe_cluster.c +322 -0
  66. package/deps/librdkafka/examples/describe_consumer_groups.c +455 -0
  67. package/deps/librdkafka/examples/describe_topics.c +427 -0
  68. package/deps/librdkafka/examples/elect_leaders.c +317 -0
  69. package/deps/librdkafka/examples/globals.json +11 -0
  70. package/deps/librdkafka/examples/idempotent_producer.c +344 -0
  71. package/deps/librdkafka/examples/incremental_alter_configs.c +347 -0
  72. package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +945 -0
  73. package/deps/librdkafka/examples/list_consumer_group_offsets.c +359 -0
  74. package/deps/librdkafka/examples/list_consumer_groups.c +365 -0
  75. package/deps/librdkafka/examples/list_offsets.c +327 -0
  76. package/deps/librdkafka/examples/misc.c +287 -0
  77. package/deps/librdkafka/examples/openssl_engine_example.cpp +248 -0
  78. package/deps/librdkafka/examples/producer.c +251 -0
  79. package/deps/librdkafka/examples/producer.cpp +228 -0
  80. package/deps/librdkafka/examples/rdkafka_complex_consumer_example.c +617 -0
  81. package/deps/librdkafka/examples/rdkafka_complex_consumer_example.cpp +467 -0
  82. package/deps/librdkafka/examples/rdkafka_consume_batch.cpp +264 -0
  83. package/deps/librdkafka/examples/rdkafka_example.c +853 -0
  84. package/deps/librdkafka/examples/rdkafka_example.cpp +679 -0
  85. package/deps/librdkafka/examples/rdkafka_performance.c +1781 -0
  86. package/deps/librdkafka/examples/transactions-older-broker.c +668 -0
  87. package/deps/librdkafka/examples/transactions.c +665 -0
  88. package/deps/librdkafka/examples/user_scram.c +491 -0
  89. package/deps/librdkafka/examples/win_ssl_cert_store.cpp +396 -0
  90. package/deps/librdkafka/lds-gen.py +73 -0
  91. package/deps/librdkafka/mainpage.doxy +40 -0
  92. package/deps/librdkafka/mklove/Makefile.base +329 -0
  93. package/deps/librdkafka/mklove/modules/configure.atomics +144 -0
  94. package/deps/librdkafka/mklove/modules/configure.base +2484 -0
  95. package/deps/librdkafka/mklove/modules/configure.builtin +70 -0
  96. package/deps/librdkafka/mklove/modules/configure.cc +186 -0
  97. package/deps/librdkafka/mklove/modules/configure.cxx +8 -0
  98. package/deps/librdkafka/mklove/modules/configure.fileversion +65 -0
  99. package/deps/librdkafka/mklove/modules/configure.gitversion +29 -0
  100. package/deps/librdkafka/mklove/modules/configure.good_cflags +18 -0
  101. package/deps/librdkafka/mklove/modules/configure.host +132 -0
  102. package/deps/librdkafka/mklove/modules/configure.lib +49 -0
  103. package/deps/librdkafka/mklove/modules/configure.libcurl +99 -0
  104. package/deps/librdkafka/mklove/modules/configure.libsasl2 +36 -0
  105. package/deps/librdkafka/mklove/modules/configure.libssl +147 -0
  106. package/deps/librdkafka/mklove/modules/configure.libzstd +58 -0
  107. package/deps/librdkafka/mklove/modules/configure.parseversion +95 -0
  108. package/deps/librdkafka/mklove/modules/configure.pic +16 -0
  109. package/deps/librdkafka/mklove/modules/configure.socket +20 -0
  110. package/deps/librdkafka/mklove/modules/configure.zlib +61 -0
  111. package/deps/librdkafka/mklove/modules/patches/README.md +8 -0
  112. package/deps/librdkafka/mklove/modules/patches/libcurl.0000-no-runtime-linking-check.patch +11 -0
  113. package/deps/librdkafka/mklove/modules/patches/libssl.0000-osx-rand-include-fix-OpenSSL-PR16409.patch +56 -0
  114. package/deps/librdkafka/packaging/RELEASE.md +319 -0
  115. package/deps/librdkafka/packaging/alpine/build-alpine.sh +38 -0
  116. package/deps/librdkafka/packaging/archlinux/PKGBUILD +30 -0
  117. package/deps/librdkafka/packaging/cmake/Config.cmake.in +37 -0
  118. package/deps/librdkafka/packaging/cmake/Modules/FindLZ4.cmake +38 -0
  119. package/deps/librdkafka/packaging/cmake/Modules/FindZSTD.cmake +27 -0
  120. package/deps/librdkafka/packaging/cmake/Modules/LICENSE.FindZstd +178 -0
  121. package/deps/librdkafka/packaging/cmake/README.md +38 -0
  122. package/deps/librdkafka/packaging/cmake/config.h.in +52 -0
  123. package/deps/librdkafka/packaging/cmake/parseversion.cmake +60 -0
  124. package/deps/librdkafka/packaging/cmake/rdkafka.pc.in +12 -0
  125. package/deps/librdkafka/packaging/cmake/try_compile/atomic_32_test.c +8 -0
  126. package/deps/librdkafka/packaging/cmake/try_compile/atomic_64_test.c +8 -0
  127. package/deps/librdkafka/packaging/cmake/try_compile/c11threads_test.c +14 -0
  128. package/deps/librdkafka/packaging/cmake/try_compile/crc32c_hw_test.c +27 -0
  129. package/deps/librdkafka/packaging/cmake/try_compile/dlopen_test.c +11 -0
  130. package/deps/librdkafka/packaging/cmake/try_compile/libsasl2_test.c +7 -0
  131. package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_darwin_test.c +6 -0
  132. package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_freebsd_test.c +7 -0
  133. package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_gnu_test.c +5 -0
  134. package/deps/librdkafka/packaging/cmake/try_compile/rand_r_test.c +7 -0
  135. package/deps/librdkafka/packaging/cmake/try_compile/rdkafka_setup.cmake +122 -0
  136. package/deps/librdkafka/packaging/cmake/try_compile/regex_test.c +10 -0
  137. package/deps/librdkafka/packaging/cmake/try_compile/strndup_test.c +5 -0
  138. package/deps/librdkafka/packaging/cmake/try_compile/sync_32_test.c +8 -0
  139. package/deps/librdkafka/packaging/cmake/try_compile/sync_64_test.c +8 -0
  140. package/deps/librdkafka/packaging/cp/README.md +16 -0
  141. package/deps/librdkafka/packaging/cp/check_features.c +72 -0
  142. package/deps/librdkafka/packaging/cp/verify-deb.sh +33 -0
  143. package/deps/librdkafka/packaging/cp/verify-packages.sh +69 -0
  144. package/deps/librdkafka/packaging/cp/verify-rpm.sh +32 -0
  145. package/deps/librdkafka/packaging/debian/changelog +66 -0
  146. package/deps/librdkafka/packaging/debian/compat +1 -0
  147. package/deps/librdkafka/packaging/debian/control +49 -0
  148. package/deps/librdkafka/packaging/debian/copyright +84 -0
  149. package/deps/librdkafka/packaging/debian/docs +5 -0
  150. package/deps/librdkafka/packaging/debian/gbp.conf +9 -0
  151. package/deps/librdkafka/packaging/debian/librdkafka-dev.dirs +2 -0
  152. package/deps/librdkafka/packaging/debian/librdkafka-dev.examples +2 -0
  153. package/deps/librdkafka/packaging/debian/librdkafka-dev.install +6 -0
  154. package/deps/librdkafka/packaging/debian/librdkafka-dev.substvars +1 -0
  155. package/deps/librdkafka/packaging/debian/librdkafka.dsc +16 -0
  156. package/deps/librdkafka/packaging/debian/librdkafka1-dbg.substvars +1 -0
  157. package/deps/librdkafka/packaging/debian/librdkafka1.dirs +1 -0
  158. package/deps/librdkafka/packaging/debian/librdkafka1.install +2 -0
  159. package/deps/librdkafka/packaging/debian/librdkafka1.postinst.debhelper +5 -0
  160. package/deps/librdkafka/packaging/debian/librdkafka1.postrm.debhelper +5 -0
  161. package/deps/librdkafka/packaging/debian/librdkafka1.symbols +64 -0
  162. package/deps/librdkafka/packaging/debian/rules +19 -0
  163. package/deps/librdkafka/packaging/debian/source/format +1 -0
  164. package/deps/librdkafka/packaging/debian/watch +2 -0
  165. package/deps/librdkafka/packaging/get_version.py +21 -0
  166. package/deps/librdkafka/packaging/homebrew/README.md +15 -0
  167. package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +31 -0
  168. package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw-static.sh +52 -0
  169. package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw.sh +21 -0
  170. package/deps/librdkafka/packaging/mingw-w64/export-variables.sh +13 -0
  171. package/deps/librdkafka/packaging/mingw-w64/run-tests.sh +6 -0
  172. package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +38 -0
  173. package/deps/librdkafka/packaging/nuget/README.md +84 -0
  174. package/deps/librdkafka/packaging/nuget/artifact.py +177 -0
  175. package/deps/librdkafka/packaging/nuget/cleanup-s3.py +143 -0
  176. package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr120.zip +0 -0
  177. package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr140.zip +0 -0
  178. package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr120.zip +0 -0
  179. package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr140.zip +0 -0
  180. package/deps/librdkafka/packaging/nuget/nuget.sh +21 -0
  181. package/deps/librdkafka/packaging/nuget/nugetpackage.py +278 -0
  182. package/deps/librdkafka/packaging/nuget/packaging.py +448 -0
  183. package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +21 -0
  184. package/deps/librdkafka/packaging/nuget/release.py +167 -0
  185. package/deps/librdkafka/packaging/nuget/requirements.txt +3 -0
  186. package/deps/librdkafka/packaging/nuget/staticpackage.py +178 -0
  187. package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.nuspec +21 -0
  188. package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.props +18 -0
  189. package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.targets +19 -0
  190. package/deps/librdkafka/packaging/nuget/zfile/__init__.py +0 -0
  191. package/deps/librdkafka/packaging/nuget/zfile/zfile.py +98 -0
  192. package/deps/librdkafka/packaging/rpm/Makefile +92 -0
  193. package/deps/librdkafka/packaging/rpm/README.md +23 -0
  194. package/deps/librdkafka/packaging/rpm/el7-x86_64.cfg +40 -0
  195. package/deps/librdkafka/packaging/rpm/librdkafka.spec +118 -0
  196. package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +96 -0
  197. package/deps/librdkafka/packaging/rpm/tests/Makefile +25 -0
  198. package/deps/librdkafka/packaging/rpm/tests/README.md +8 -0
  199. package/deps/librdkafka/packaging/rpm/tests/run-test.sh +42 -0
  200. package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +56 -0
  201. package/deps/librdkafka/packaging/rpm/tests/test.c +77 -0
  202. package/deps/librdkafka/packaging/rpm/tests/test.cpp +34 -0
  203. package/deps/librdkafka/packaging/tools/Dockerfile +31 -0
  204. package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +12 -0
  205. package/deps/librdkafka/packaging/tools/build-deb-package.sh +64 -0
  206. package/deps/librdkafka/packaging/tools/build-debian.sh +65 -0
  207. package/deps/librdkafka/packaging/tools/build-manylinux.sh +68 -0
  208. package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +139 -0
  209. package/deps/librdkafka/packaging/tools/distro-build.sh +38 -0
  210. package/deps/librdkafka/packaging/tools/gh-release-checksums.py +39 -0
  211. package/deps/librdkafka/packaging/tools/rdutcoverage.sh +25 -0
  212. package/deps/librdkafka/packaging/tools/requirements.txt +2 -0
  213. package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
  214. package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
  215. package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
  216. package/deps/librdkafka/packaging/tools/style-format.sh +149 -0
  217. package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
  218. package/deps/librdkafka/service.yml +172 -0
  219. package/deps/librdkafka/src/CMakeLists.txt +374 -0
  220. package/deps/librdkafka/src/Makefile +103 -0
  221. package/deps/librdkafka/src/README.lz4.md +30 -0
  222. package/deps/librdkafka/src/cJSON.c +2834 -0
  223. package/deps/librdkafka/src/cJSON.h +398 -0
  224. package/deps/librdkafka/src/crc32c.c +430 -0
  225. package/deps/librdkafka/src/crc32c.h +38 -0
  226. package/deps/librdkafka/src/generate_proto.sh +66 -0
  227. package/deps/librdkafka/src/librdkafka_cgrp_synch.png +0 -0
  228. package/deps/librdkafka/src/lz4.c +2727 -0
  229. package/deps/librdkafka/src/lz4.h +842 -0
  230. package/deps/librdkafka/src/lz4frame.c +2078 -0
  231. package/deps/librdkafka/src/lz4frame.h +692 -0
  232. package/deps/librdkafka/src/lz4frame_static.h +47 -0
  233. package/deps/librdkafka/src/lz4hc.c +1631 -0
  234. package/deps/librdkafka/src/lz4hc.h +413 -0
  235. package/deps/librdkafka/src/nanopb/pb.h +917 -0
  236. package/deps/librdkafka/src/nanopb/pb_common.c +388 -0
  237. package/deps/librdkafka/src/nanopb/pb_common.h +49 -0
  238. package/deps/librdkafka/src/nanopb/pb_decode.c +1727 -0
  239. package/deps/librdkafka/src/nanopb/pb_decode.h +193 -0
  240. package/deps/librdkafka/src/nanopb/pb_encode.c +1000 -0
  241. package/deps/librdkafka/src/nanopb/pb_encode.h +185 -0
  242. package/deps/librdkafka/src/opentelemetry/common.pb.c +32 -0
  243. package/deps/librdkafka/src/opentelemetry/common.pb.h +170 -0
  244. package/deps/librdkafka/src/opentelemetry/metrics.options +2 -0
  245. package/deps/librdkafka/src/opentelemetry/metrics.pb.c +67 -0
  246. package/deps/librdkafka/src/opentelemetry/metrics.pb.h +966 -0
  247. package/deps/librdkafka/src/opentelemetry/resource.pb.c +12 -0
  248. package/deps/librdkafka/src/opentelemetry/resource.pb.h +58 -0
  249. package/deps/librdkafka/src/queue.h +850 -0
  250. package/deps/librdkafka/src/rd.h +584 -0
  251. package/deps/librdkafka/src/rdaddr.c +255 -0
  252. package/deps/librdkafka/src/rdaddr.h +202 -0
  253. package/deps/librdkafka/src/rdatomic.h +230 -0
  254. package/deps/librdkafka/src/rdavg.h +260 -0
  255. package/deps/librdkafka/src/rdavl.c +210 -0
  256. package/deps/librdkafka/src/rdavl.h +250 -0
  257. package/deps/librdkafka/src/rdbase64.c +200 -0
  258. package/deps/librdkafka/src/rdbase64.h +43 -0
  259. package/deps/librdkafka/src/rdbuf.c +1884 -0
  260. package/deps/librdkafka/src/rdbuf.h +375 -0
  261. package/deps/librdkafka/src/rdcrc32.c +114 -0
  262. package/deps/librdkafka/src/rdcrc32.h +170 -0
  263. package/deps/librdkafka/src/rddl.c +179 -0
  264. package/deps/librdkafka/src/rddl.h +43 -0
  265. package/deps/librdkafka/src/rdendian.h +175 -0
  266. package/deps/librdkafka/src/rdfloat.h +67 -0
  267. package/deps/librdkafka/src/rdfnv1a.c +113 -0
  268. package/deps/librdkafka/src/rdfnv1a.h +35 -0
  269. package/deps/librdkafka/src/rdgz.c +120 -0
  270. package/deps/librdkafka/src/rdgz.h +46 -0
  271. package/deps/librdkafka/src/rdhdrhistogram.c +721 -0
  272. package/deps/librdkafka/src/rdhdrhistogram.h +87 -0
  273. package/deps/librdkafka/src/rdhttp.c +830 -0
  274. package/deps/librdkafka/src/rdhttp.h +101 -0
  275. package/deps/librdkafka/src/rdinterval.h +177 -0
  276. package/deps/librdkafka/src/rdkafka.c +5505 -0
  277. package/deps/librdkafka/src/rdkafka.h +10686 -0
  278. package/deps/librdkafka/src/rdkafka_admin.c +9794 -0
  279. package/deps/librdkafka/src/rdkafka_admin.h +661 -0
  280. package/deps/librdkafka/src/rdkafka_assignment.c +1010 -0
  281. package/deps/librdkafka/src/rdkafka_assignment.h +73 -0
  282. package/deps/librdkafka/src/rdkafka_assignor.c +1786 -0
  283. package/deps/librdkafka/src/rdkafka_assignor.h +402 -0
  284. package/deps/librdkafka/src/rdkafka_aux.c +409 -0
  285. package/deps/librdkafka/src/rdkafka_aux.h +174 -0
  286. package/deps/librdkafka/src/rdkafka_background.c +221 -0
  287. package/deps/librdkafka/src/rdkafka_broker.c +6337 -0
  288. package/deps/librdkafka/src/rdkafka_broker.h +744 -0
  289. package/deps/librdkafka/src/rdkafka_buf.c +543 -0
  290. package/deps/librdkafka/src/rdkafka_buf.h +1525 -0
  291. package/deps/librdkafka/src/rdkafka_cert.c +576 -0
  292. package/deps/librdkafka/src/rdkafka_cert.h +62 -0
  293. package/deps/librdkafka/src/rdkafka_cgrp.c +7587 -0
  294. package/deps/librdkafka/src/rdkafka_cgrp.h +477 -0
  295. package/deps/librdkafka/src/rdkafka_conf.c +4880 -0
  296. package/deps/librdkafka/src/rdkafka_conf.h +732 -0
  297. package/deps/librdkafka/src/rdkafka_confval.h +97 -0
  298. package/deps/librdkafka/src/rdkafka_coord.c +623 -0
  299. package/deps/librdkafka/src/rdkafka_coord.h +132 -0
  300. package/deps/librdkafka/src/rdkafka_error.c +228 -0
  301. package/deps/librdkafka/src/rdkafka_error.h +80 -0
  302. package/deps/librdkafka/src/rdkafka_event.c +502 -0
  303. package/deps/librdkafka/src/rdkafka_event.h +126 -0
  304. package/deps/librdkafka/src/rdkafka_feature.c +898 -0
  305. package/deps/librdkafka/src/rdkafka_feature.h +104 -0
  306. package/deps/librdkafka/src/rdkafka_fetcher.c +1422 -0
  307. package/deps/librdkafka/src/rdkafka_fetcher.h +44 -0
  308. package/deps/librdkafka/src/rdkafka_header.c +220 -0
  309. package/deps/librdkafka/src/rdkafka_header.h +76 -0
  310. package/deps/librdkafka/src/rdkafka_idempotence.c +807 -0
  311. package/deps/librdkafka/src/rdkafka_idempotence.h +144 -0
  312. package/deps/librdkafka/src/rdkafka_int.h +1260 -0
  313. package/deps/librdkafka/src/rdkafka_interceptor.c +819 -0
  314. package/deps/librdkafka/src/rdkafka_interceptor.h +104 -0
  315. package/deps/librdkafka/src/rdkafka_lz4.c +450 -0
  316. package/deps/librdkafka/src/rdkafka_lz4.h +49 -0
  317. package/deps/librdkafka/src/rdkafka_metadata.c +2209 -0
  318. package/deps/librdkafka/src/rdkafka_metadata.h +345 -0
  319. package/deps/librdkafka/src/rdkafka_metadata_cache.c +1183 -0
  320. package/deps/librdkafka/src/rdkafka_mock.c +3661 -0
  321. package/deps/librdkafka/src/rdkafka_mock.h +610 -0
  322. package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1876 -0
  323. package/deps/librdkafka/src/rdkafka_mock_handlers.c +3113 -0
  324. package/deps/librdkafka/src/rdkafka_mock_int.h +710 -0
  325. package/deps/librdkafka/src/rdkafka_msg.c +2589 -0
  326. package/deps/librdkafka/src/rdkafka_msg.h +614 -0
  327. package/deps/librdkafka/src/rdkafka_msgbatch.h +62 -0
  328. package/deps/librdkafka/src/rdkafka_msgset.h +98 -0
  329. package/deps/librdkafka/src/rdkafka_msgset_reader.c +1806 -0
  330. package/deps/librdkafka/src/rdkafka_msgset_writer.c +1474 -0
  331. package/deps/librdkafka/src/rdkafka_offset.c +1565 -0
  332. package/deps/librdkafka/src/rdkafka_offset.h +150 -0
  333. package/deps/librdkafka/src/rdkafka_op.c +997 -0
  334. package/deps/librdkafka/src/rdkafka_op.h +858 -0
  335. package/deps/librdkafka/src/rdkafka_partition.c +4896 -0
  336. package/deps/librdkafka/src/rdkafka_partition.h +1182 -0
  337. package/deps/librdkafka/src/rdkafka_pattern.c +228 -0
  338. package/deps/librdkafka/src/rdkafka_pattern.h +70 -0
  339. package/deps/librdkafka/src/rdkafka_plugin.c +213 -0
  340. package/deps/librdkafka/src/rdkafka_plugin.h +41 -0
  341. package/deps/librdkafka/src/rdkafka_proto.h +736 -0
  342. package/deps/librdkafka/src/rdkafka_protocol.h +128 -0
  343. package/deps/librdkafka/src/rdkafka_queue.c +1230 -0
  344. package/deps/librdkafka/src/rdkafka_queue.h +1220 -0
  345. package/deps/librdkafka/src/rdkafka_range_assignor.c +1748 -0
  346. package/deps/librdkafka/src/rdkafka_request.c +7089 -0
  347. package/deps/librdkafka/src/rdkafka_request.h +732 -0
  348. package/deps/librdkafka/src/rdkafka_roundrobin_assignor.c +123 -0
  349. package/deps/librdkafka/src/rdkafka_sasl.c +530 -0
  350. package/deps/librdkafka/src/rdkafka_sasl.h +63 -0
  351. package/deps/librdkafka/src/rdkafka_sasl_cyrus.c +722 -0
  352. package/deps/librdkafka/src/rdkafka_sasl_int.h +89 -0
  353. package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +1833 -0
  354. package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.h +52 -0
  355. package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1666 -0
  356. package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +47 -0
  357. package/deps/librdkafka/src/rdkafka_sasl_plain.c +142 -0
  358. package/deps/librdkafka/src/rdkafka_sasl_scram.c +858 -0
  359. package/deps/librdkafka/src/rdkafka_sasl_win32.c +550 -0
  360. package/deps/librdkafka/src/rdkafka_ssl.c +2129 -0
  361. package/deps/librdkafka/src/rdkafka_ssl.h +86 -0
  362. package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4785 -0
  363. package/deps/librdkafka/src/rdkafka_subscription.c +278 -0
  364. package/deps/librdkafka/src/rdkafka_telemetry.c +760 -0
  365. package/deps/librdkafka/src/rdkafka_telemetry.h +52 -0
  366. package/deps/librdkafka/src/rdkafka_telemetry_decode.c +1053 -0
  367. package/deps/librdkafka/src/rdkafka_telemetry_decode.h +59 -0
  368. package/deps/librdkafka/src/rdkafka_telemetry_encode.c +997 -0
  369. package/deps/librdkafka/src/rdkafka_telemetry_encode.h +301 -0
  370. package/deps/librdkafka/src/rdkafka_timer.c +402 -0
  371. package/deps/librdkafka/src/rdkafka_timer.h +117 -0
  372. package/deps/librdkafka/src/rdkafka_topic.c +2161 -0
  373. package/deps/librdkafka/src/rdkafka_topic.h +334 -0
  374. package/deps/librdkafka/src/rdkafka_transport.c +1309 -0
  375. package/deps/librdkafka/src/rdkafka_transport.h +99 -0
  376. package/deps/librdkafka/src/rdkafka_transport_int.h +100 -0
  377. package/deps/librdkafka/src/rdkafka_txnmgr.c +3256 -0
  378. package/deps/librdkafka/src/rdkafka_txnmgr.h +171 -0
  379. package/deps/librdkafka/src/rdkafka_zstd.c +226 -0
  380. package/deps/librdkafka/src/rdkafka_zstd.h +57 -0
  381. package/deps/librdkafka/src/rdlist.c +576 -0
  382. package/deps/librdkafka/src/rdlist.h +434 -0
  383. package/deps/librdkafka/src/rdlog.c +89 -0
  384. package/deps/librdkafka/src/rdlog.h +41 -0
  385. package/deps/librdkafka/src/rdmap.c +508 -0
  386. package/deps/librdkafka/src/rdmap.h +492 -0
  387. package/deps/librdkafka/src/rdmurmur2.c +167 -0
  388. package/deps/librdkafka/src/rdmurmur2.h +35 -0
  389. package/deps/librdkafka/src/rdports.c +61 -0
  390. package/deps/librdkafka/src/rdports.h +38 -0
  391. package/deps/librdkafka/src/rdposix.h +250 -0
  392. package/deps/librdkafka/src/rdrand.c +80 -0
  393. package/deps/librdkafka/src/rdrand.h +43 -0
  394. package/deps/librdkafka/src/rdregex.c +156 -0
  395. package/deps/librdkafka/src/rdregex.h +43 -0
  396. package/deps/librdkafka/src/rdsignal.h +57 -0
  397. package/deps/librdkafka/src/rdstring.c +645 -0
  398. package/deps/librdkafka/src/rdstring.h +98 -0
  399. package/deps/librdkafka/src/rdsysqueue.h +404 -0
  400. package/deps/librdkafka/src/rdtime.h +356 -0
  401. package/deps/librdkafka/src/rdtypes.h +86 -0
  402. package/deps/librdkafka/src/rdunittest.c +549 -0
  403. package/deps/librdkafka/src/rdunittest.h +232 -0
  404. package/deps/librdkafka/src/rdvarint.c +134 -0
  405. package/deps/librdkafka/src/rdvarint.h +165 -0
  406. package/deps/librdkafka/src/rdwin32.h +382 -0
  407. package/deps/librdkafka/src/rdxxhash.c +1030 -0
  408. package/deps/librdkafka/src/rdxxhash.h +328 -0
  409. package/deps/librdkafka/src/regexp.c +1352 -0
  410. package/deps/librdkafka/src/regexp.h +41 -0
  411. package/deps/librdkafka/src/snappy.c +1866 -0
  412. package/deps/librdkafka/src/snappy.h +62 -0
  413. package/deps/librdkafka/src/snappy_compat.h +138 -0
  414. package/deps/librdkafka/src/statistics_schema.json +444 -0
  415. package/deps/librdkafka/src/tinycthread.c +932 -0
  416. package/deps/librdkafka/src/tinycthread.h +503 -0
  417. package/deps/librdkafka/src/tinycthread_extra.c +199 -0
  418. package/deps/librdkafka/src/tinycthread_extra.h +212 -0
  419. package/deps/librdkafka/src/win32_config.h +58 -0
  420. package/deps/librdkafka/src-cpp/CMakeLists.txt +90 -0
  421. package/deps/librdkafka/src-cpp/ConfImpl.cpp +84 -0
  422. package/deps/librdkafka/src-cpp/ConsumerImpl.cpp +244 -0
  423. package/deps/librdkafka/src-cpp/HandleImpl.cpp +436 -0
  424. package/deps/librdkafka/src-cpp/HeadersImpl.cpp +48 -0
  425. package/deps/librdkafka/src-cpp/KafkaConsumerImpl.cpp +296 -0
  426. package/deps/librdkafka/src-cpp/Makefile +55 -0
  427. package/deps/librdkafka/src-cpp/MessageImpl.cpp +38 -0
  428. package/deps/librdkafka/src-cpp/MetadataImpl.cpp +170 -0
  429. package/deps/librdkafka/src-cpp/ProducerImpl.cpp +197 -0
  430. package/deps/librdkafka/src-cpp/QueueImpl.cpp +70 -0
  431. package/deps/librdkafka/src-cpp/README.md +16 -0
  432. package/deps/librdkafka/src-cpp/RdKafka.cpp +59 -0
  433. package/deps/librdkafka/src-cpp/TopicImpl.cpp +124 -0
  434. package/deps/librdkafka/src-cpp/TopicPartitionImpl.cpp +57 -0
  435. package/deps/librdkafka/src-cpp/rdkafkacpp.h +3797 -0
  436. package/deps/librdkafka/src-cpp/rdkafkacpp_int.h +1641 -0
  437. package/deps/librdkafka/tests/0000-unittests.c +72 -0
  438. package/deps/librdkafka/tests/0001-multiobj.c +102 -0
  439. package/deps/librdkafka/tests/0002-unkpart.c +244 -0
  440. package/deps/librdkafka/tests/0003-msgmaxsize.c +173 -0
  441. package/deps/librdkafka/tests/0004-conf.c +934 -0
  442. package/deps/librdkafka/tests/0005-order.c +133 -0
  443. package/deps/librdkafka/tests/0006-symbols.c +163 -0
  444. package/deps/librdkafka/tests/0007-autotopic.c +136 -0
  445. package/deps/librdkafka/tests/0008-reqacks.c +179 -0
  446. package/deps/librdkafka/tests/0009-mock_cluster.c +97 -0
  447. package/deps/librdkafka/tests/0011-produce_batch.c +753 -0
  448. package/deps/librdkafka/tests/0012-produce_consume.c +537 -0
  449. package/deps/librdkafka/tests/0013-null-msgs.c +473 -0
  450. package/deps/librdkafka/tests/0014-reconsume-191.c +512 -0
  451. package/deps/librdkafka/tests/0015-offset_seeks.c +172 -0
  452. package/deps/librdkafka/tests/0016-client_swname.c +181 -0
  453. package/deps/librdkafka/tests/0017-compression.c +140 -0
  454. package/deps/librdkafka/tests/0018-cgrp_term.c +338 -0
  455. package/deps/librdkafka/tests/0019-list_groups.c +289 -0
  456. package/deps/librdkafka/tests/0020-destroy_hang.c +162 -0
  457. package/deps/librdkafka/tests/0021-rkt_destroy.c +72 -0
  458. package/deps/librdkafka/tests/0022-consume_batch.c +279 -0
  459. package/deps/librdkafka/tests/0025-timers.c +147 -0
  460. package/deps/librdkafka/tests/0026-consume_pause.c +547 -0
  461. package/deps/librdkafka/tests/0028-long_topicnames.c +79 -0
  462. package/deps/librdkafka/tests/0029-assign_offset.c +202 -0
  463. package/deps/librdkafka/tests/0030-offset_commit.c +589 -0
  464. package/deps/librdkafka/tests/0031-get_offsets.c +235 -0
  465. package/deps/librdkafka/tests/0033-regex_subscribe.c +536 -0
  466. package/deps/librdkafka/tests/0034-offset_reset.c +398 -0
  467. package/deps/librdkafka/tests/0035-api_version.c +73 -0
  468. package/deps/librdkafka/tests/0036-partial_fetch.c +87 -0
  469. package/deps/librdkafka/tests/0037-destroy_hang_local.c +85 -0
  470. package/deps/librdkafka/tests/0038-performance.c +121 -0
  471. package/deps/librdkafka/tests/0039-event.c +284 -0
  472. package/deps/librdkafka/tests/0040-io_event.c +257 -0
  473. package/deps/librdkafka/tests/0041-fetch_max_bytes.c +97 -0
  474. package/deps/librdkafka/tests/0042-many_topics.c +252 -0
  475. package/deps/librdkafka/tests/0043-no_connection.c +77 -0
  476. package/deps/librdkafka/tests/0044-partition_cnt.c +94 -0
  477. package/deps/librdkafka/tests/0045-subscribe_update.c +1010 -0
  478. package/deps/librdkafka/tests/0046-rkt_cache.c +65 -0
  479. package/deps/librdkafka/tests/0047-partial_buf_tmout.c +98 -0
  480. package/deps/librdkafka/tests/0048-partitioner.c +283 -0
  481. package/deps/librdkafka/tests/0049-consume_conn_close.c +162 -0
  482. package/deps/librdkafka/tests/0050-subscribe_adds.c +145 -0
  483. package/deps/librdkafka/tests/0051-assign_adds.c +126 -0
  484. package/deps/librdkafka/tests/0052-msg_timestamps.c +238 -0
  485. package/deps/librdkafka/tests/0053-stats_cb.cpp +527 -0
  486. package/deps/librdkafka/tests/0054-offset_time.cpp +236 -0
  487. package/deps/librdkafka/tests/0055-producer_latency.c +539 -0
  488. package/deps/librdkafka/tests/0056-balanced_group_mt.c +315 -0
  489. package/deps/librdkafka/tests/0057-invalid_topic.cpp +112 -0
  490. package/deps/librdkafka/tests/0058-log.cpp +123 -0
  491. package/deps/librdkafka/tests/0059-bsearch.cpp +241 -0
  492. package/deps/librdkafka/tests/0060-op_prio.cpp +163 -0
  493. package/deps/librdkafka/tests/0061-consumer_lag.cpp +295 -0
  494. package/deps/librdkafka/tests/0062-stats_event.c +126 -0
  495. package/deps/librdkafka/tests/0063-clusterid.cpp +180 -0
  496. package/deps/librdkafka/tests/0064-interceptors.c +481 -0
  497. package/deps/librdkafka/tests/0065-yield.cpp +140 -0
  498. package/deps/librdkafka/tests/0066-plugins.cpp +129 -0
  499. package/deps/librdkafka/tests/0067-empty_topic.cpp +151 -0
  500. package/deps/librdkafka/tests/0068-produce_timeout.c +136 -0
  501. package/deps/librdkafka/tests/0069-consumer_add_parts.c +119 -0
  502. package/deps/librdkafka/tests/0070-null_empty.cpp +197 -0
  503. package/deps/librdkafka/tests/0072-headers_ut.c +448 -0
  504. package/deps/librdkafka/tests/0073-headers.c +381 -0
  505. package/deps/librdkafka/tests/0074-producev.c +87 -0
  506. package/deps/librdkafka/tests/0075-retry.c +290 -0
  507. package/deps/librdkafka/tests/0076-produce_retry.c +452 -0
  508. package/deps/librdkafka/tests/0077-compaction.c +363 -0
  509. package/deps/librdkafka/tests/0078-c_from_cpp.cpp +96 -0
  510. package/deps/librdkafka/tests/0079-fork.c +93 -0
  511. package/deps/librdkafka/tests/0080-admin_ut.c +3095 -0
  512. package/deps/librdkafka/tests/0081-admin.c +5633 -0
  513. package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +137 -0
  514. package/deps/librdkafka/tests/0083-cb_event.c +233 -0
  515. package/deps/librdkafka/tests/0084-destroy_flags.c +208 -0
  516. package/deps/librdkafka/tests/0085-headers.cpp +392 -0
  517. package/deps/librdkafka/tests/0086-purge.c +368 -0
  518. package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +162 -0
  519. package/deps/librdkafka/tests/0089-max_poll_interval.c +511 -0
  520. package/deps/librdkafka/tests/0090-idempotence.c +171 -0
  521. package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +295 -0
  522. package/deps/librdkafka/tests/0092-mixed_msgver.c +103 -0
  523. package/deps/librdkafka/tests/0093-holb.c +200 -0
  524. package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +231 -0
  525. package/deps/librdkafka/tests/0095-all_brokers_down.cpp +122 -0
  526. package/deps/librdkafka/tests/0097-ssl_verify.cpp +658 -0
  527. package/deps/librdkafka/tests/0098-consumer-txn.cpp +1218 -0
  528. package/deps/librdkafka/tests/0099-commit_metadata.c +194 -0
  529. package/deps/librdkafka/tests/0100-thread_interceptors.cpp +195 -0
  530. package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +446 -0
  531. package/deps/librdkafka/tests/0102-static_group_rebalance.c +836 -0
  532. package/deps/librdkafka/tests/0103-transactions.c +1383 -0
  533. package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +625 -0
  534. package/deps/librdkafka/tests/0105-transactions_mock.c +3930 -0
  535. package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +318 -0
  536. package/deps/librdkafka/tests/0107-topic_recreate.c +259 -0
  537. package/deps/librdkafka/tests/0109-auto_create_topics.cpp +278 -0
  538. package/deps/librdkafka/tests/0110-batch_size.cpp +182 -0
  539. package/deps/librdkafka/tests/0111-delay_create_topics.cpp +127 -0
  540. package/deps/librdkafka/tests/0112-assign_unknown_part.c +87 -0
  541. package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +3473 -0
  542. package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +176 -0
  543. package/deps/librdkafka/tests/0115-producer_auth.cpp +182 -0
  544. package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +216 -0
  545. package/deps/librdkafka/tests/0117-mock_errors.c +331 -0
  546. package/deps/librdkafka/tests/0118-commit_rebalance.c +154 -0
  547. package/deps/librdkafka/tests/0119-consumer_auth.cpp +167 -0
  548. package/deps/librdkafka/tests/0120-asymmetric_subscription.c +185 -0
  549. package/deps/librdkafka/tests/0121-clusterid.c +115 -0
  550. package/deps/librdkafka/tests/0122-buffer_cleaning_after_rebalance.c +227 -0
  551. package/deps/librdkafka/tests/0123-connections_max_idle.c +98 -0
  552. package/deps/librdkafka/tests/0124-openssl_invalid_engine.c +69 -0
  553. package/deps/librdkafka/tests/0125-immediate_flush.c +144 -0
  554. package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +528 -0
  555. package/deps/librdkafka/tests/0127-fetch_queue_backoff.cpp +165 -0
  556. package/deps/librdkafka/tests/0128-sasl_callback_queue.cpp +125 -0
  557. package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +79 -0
  558. package/deps/librdkafka/tests/0130-store_offsets.c +178 -0
  559. package/deps/librdkafka/tests/0131-connect_timeout.c +81 -0
  560. package/deps/librdkafka/tests/0132-strategy_ordering.c +179 -0
  561. package/deps/librdkafka/tests/0133-ssl_keys.c +150 -0
  562. package/deps/librdkafka/tests/0134-ssl_provider.c +92 -0
  563. package/deps/librdkafka/tests/0135-sasl_credentials.cpp +143 -0
  564. package/deps/librdkafka/tests/0136-resolve_cb.c +181 -0
  565. package/deps/librdkafka/tests/0137-barrier_batch_consume.c +619 -0
  566. package/deps/librdkafka/tests/0138-admin_mock.c +281 -0
  567. package/deps/librdkafka/tests/0139-offset_validation_mock.c +950 -0
  568. package/deps/librdkafka/tests/0140-commit_metadata.cpp +108 -0
  569. package/deps/librdkafka/tests/0142-reauthentication.c +515 -0
  570. package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +552 -0
  571. package/deps/librdkafka/tests/0144-idempotence_mock.c +373 -0
  572. package/deps/librdkafka/tests/0145-pause_resume_mock.c +119 -0
  573. package/deps/librdkafka/tests/0146-metadata_mock.c +505 -0
  574. package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
  575. package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
  576. package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
  577. package/deps/librdkafka/tests/0150-telemetry_mock.c +651 -0
  578. package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
  579. package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
  580. package/deps/librdkafka/tests/0153-memberid.c +128 -0
  581. package/deps/librdkafka/tests/1000-unktopic.c +164 -0
  582. package/deps/librdkafka/tests/8000-idle.cpp +60 -0
  583. package/deps/librdkafka/tests/8001-fetch_from_follower_mock_manual.c +113 -0
  584. package/deps/librdkafka/tests/CMakeLists.txt +170 -0
  585. package/deps/librdkafka/tests/LibrdkafkaTestApp.py +291 -0
  586. package/deps/librdkafka/tests/Makefile +182 -0
  587. package/deps/librdkafka/tests/README.md +509 -0
  588. package/deps/librdkafka/tests/autotest.sh +33 -0
  589. package/deps/librdkafka/tests/backtrace.gdb +30 -0
  590. package/deps/librdkafka/tests/broker_version_tests.py +315 -0
  591. package/deps/librdkafka/tests/buildbox.sh +17 -0
  592. package/deps/librdkafka/tests/cleanup-checker-tests.sh +20 -0
  593. package/deps/librdkafka/tests/cluster_testing.py +191 -0
  594. package/deps/librdkafka/tests/delete-test-topics.sh +56 -0
  595. package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
  596. package/deps/librdkafka/tests/fixtures/ssl/Makefile +8 -0
  597. package/deps/librdkafka/tests/fixtures/ssl/README.md +13 -0
  598. package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
  599. package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
  600. package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
  601. package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +50 -0
  602. package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
  603. package/deps/librdkafka/tests/fixtures/ssl/client2.key +46 -0
  604. package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +168 -0
  605. package/deps/librdkafka/tests/fuzzers/Makefile +12 -0
  606. package/deps/librdkafka/tests/fuzzers/README.md +31 -0
  607. package/deps/librdkafka/tests/fuzzers/fuzz_regex.c +74 -0
  608. package/deps/librdkafka/tests/fuzzers/helpers.h +90 -0
  609. package/deps/librdkafka/tests/gen-ssl-certs.sh +165 -0
  610. package/deps/librdkafka/tests/interactive_broker_version.py +170 -0
  611. package/deps/librdkafka/tests/interceptor_test/CMakeLists.txt +16 -0
  612. package/deps/librdkafka/tests/interceptor_test/Makefile +22 -0
  613. package/deps/librdkafka/tests/interceptor_test/interceptor_test.c +314 -0
  614. package/deps/librdkafka/tests/interceptor_test/interceptor_test.h +54 -0
  615. package/deps/librdkafka/tests/java/IncrementalRebalanceCli.java +97 -0
  616. package/deps/librdkafka/tests/java/Makefile +13 -0
  617. package/deps/librdkafka/tests/java/Murmur2Cli.java +46 -0
  618. package/deps/librdkafka/tests/java/README.md +14 -0
  619. package/deps/librdkafka/tests/java/TransactionProducerCli.java +162 -0
  620. package/deps/librdkafka/tests/java/run-class.sh +11 -0
  621. package/deps/librdkafka/tests/librdkafka.suppressions +483 -0
  622. package/deps/librdkafka/tests/lz4_manual_test.sh +59 -0
  623. package/deps/librdkafka/tests/multi-broker-version-test.sh +50 -0
  624. package/deps/librdkafka/tests/parse-refcnt.sh +43 -0
  625. package/deps/librdkafka/tests/performance_plot.py +115 -0
  626. package/deps/librdkafka/tests/plugin_test/Makefile +19 -0
  627. package/deps/librdkafka/tests/plugin_test/plugin_test.c +58 -0
  628. package/deps/librdkafka/tests/requirements.txt +2 -0
  629. package/deps/librdkafka/tests/run-all-tests.sh +79 -0
  630. package/deps/librdkafka/tests/run-consumer-tests.sh +16 -0
  631. package/deps/librdkafka/tests/run-producer-tests.sh +16 -0
  632. package/deps/librdkafka/tests/run-test-batches.py +157 -0
  633. package/deps/librdkafka/tests/run-test.sh +140 -0
  634. package/deps/librdkafka/tests/rusage.c +249 -0
  635. package/deps/librdkafka/tests/sasl_test.py +289 -0
  636. package/deps/librdkafka/tests/scenarios/README.md +6 -0
  637. package/deps/librdkafka/tests/scenarios/ak23.json +6 -0
  638. package/deps/librdkafka/tests/scenarios/default.json +5 -0
  639. package/deps/librdkafka/tests/scenarios/noautocreate.json +5 -0
  640. package/deps/librdkafka/tests/sockem.c +801 -0
  641. package/deps/librdkafka/tests/sockem.h +85 -0
  642. package/deps/librdkafka/tests/sockem_ctrl.c +145 -0
  643. package/deps/librdkafka/tests/sockem_ctrl.h +61 -0
  644. package/deps/librdkafka/tests/test.c +7778 -0
  645. package/deps/librdkafka/tests/test.conf.example +27 -0
  646. package/deps/librdkafka/tests/test.h +1028 -0
  647. package/deps/librdkafka/tests/testcpp.cpp +131 -0
  648. package/deps/librdkafka/tests/testcpp.h +388 -0
  649. package/deps/librdkafka/tests/testshared.h +416 -0
  650. package/deps/librdkafka/tests/tools/README.md +4 -0
  651. package/deps/librdkafka/tests/tools/stats/README.md +21 -0
  652. package/deps/librdkafka/tests/tools/stats/filter.jq +42 -0
  653. package/deps/librdkafka/tests/tools/stats/graph.py +150 -0
  654. package/deps/librdkafka/tests/tools/stats/requirements.txt +3 -0
  655. package/deps/librdkafka/tests/tools/stats/to_csv.py +124 -0
  656. package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
  657. package/deps/librdkafka/tests/until-fail.sh +87 -0
  658. package/deps/librdkafka/tests/xxxx-assign_partition.c +122 -0
  659. package/deps/librdkafka/tests/xxxx-metadata.cpp +159 -0
  660. package/deps/librdkafka/vcpkg.json +23 -0
  661. package/deps/librdkafka/win32/README.md +5 -0
  662. package/deps/librdkafka/win32/build-package.bat +3 -0
  663. package/deps/librdkafka/win32/build.bat +19 -0
  664. package/deps/librdkafka/win32/common.vcxproj +84 -0
  665. package/deps/librdkafka/win32/interceptor_test/interceptor_test.vcxproj +87 -0
  666. package/deps/librdkafka/win32/librdkafka.autopkg.template +54 -0
  667. package/deps/librdkafka/win32/librdkafka.master.testing.targets +13 -0
  668. package/deps/librdkafka/win32/librdkafka.sln +226 -0
  669. package/deps/librdkafka/win32/librdkafka.vcxproj +276 -0
  670. package/deps/librdkafka/win32/librdkafkacpp/librdkafkacpp.vcxproj +104 -0
  671. package/deps/librdkafka/win32/msbuild.ps1 +15 -0
  672. package/deps/librdkafka/win32/openssl_engine_example/openssl_engine_example.vcxproj +132 -0
  673. package/deps/librdkafka/win32/package-zip.ps1 +46 -0
  674. package/deps/librdkafka/win32/packages/repositories.config +4 -0
  675. package/deps/librdkafka/win32/push-package.bat +4 -0
  676. package/deps/librdkafka/win32/rdkafka_complex_consumer_example_cpp/rdkafka_complex_consumer_example_cpp.vcxproj +67 -0
  677. package/deps/librdkafka/win32/rdkafka_example/rdkafka_example.vcxproj +97 -0
  678. package/deps/librdkafka/win32/rdkafka_performance/rdkafka_performance.vcxproj +97 -0
  679. package/deps/librdkafka/win32/setup-msys2.ps1 +47 -0
  680. package/deps/librdkafka/win32/setup-vcpkg.ps1 +34 -0
  681. package/deps/librdkafka/win32/tests/test.conf.example +25 -0
  682. package/deps/librdkafka/win32/tests/tests.vcxproj +253 -0
  683. package/deps/librdkafka/win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj +132 -0
  684. package/deps/librdkafka/win32/wingetopt.c +564 -0
  685. package/deps/librdkafka/win32/wingetopt.h +101 -0
  686. package/deps/librdkafka/win32/wintime.h +33 -0
  687. package/deps/librdkafka.gyp +62 -0
  688. package/lib/admin.js +233 -0
  689. package/lib/client.js +573 -0
  690. package/lib/error.js +500 -0
  691. package/lib/index.js +34 -0
  692. package/lib/kafka-consumer-stream.js +397 -0
  693. package/lib/kafka-consumer.js +698 -0
  694. package/lib/producer/high-level-producer.js +323 -0
  695. package/lib/producer-stream.js +307 -0
  696. package/lib/producer.js +375 -0
  697. package/lib/tools/ref-counter.js +52 -0
  698. package/lib/topic-partition.js +88 -0
  699. package/lib/topic.js +42 -0
  700. package/lib/util.js +29 -0
  701. package/package.json +61 -0
  702. package/prebuilds/darwin-arm64/@point3+node-rdkafka.node +0 -0
  703. package/prebuilds/linux-x64/@point3+node-rdkafka.node +0 -0
  704. package/util/configure.js +30 -0
  705. package/util/get-env.js +6 -0
  706. package/util/test-compile.js +11 -0
  707. package/util/test-producer-delivery.js +100 -0
@@ -0,0 +1,1028 @@
1
+ /*
2
+ * librdkafka - Apache Kafka C library
3
+ *
4
+ * Copyright (c) 2012-2022, Magnus Edenhill
5
+ * 2023, Confluent Inc.
6
+ * All rights reserved.
7
+ *
8
+ * Redistribution and use in source and binary forms, with or without
9
+ * modification, are permitted provided that the following conditions are met:
10
+ *
11
+ * 1. Redistributions of source code must retain the above copyright notice,
12
+ * this list of conditions and the following disclaimer.
13
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
14
+ * this list of conditions and the following disclaimer in the documentation
15
+ * and/or other materials provided with the distribution.
16
+ *
17
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
+ * POSSIBILITY OF SUCH DAMAGE.
28
+ */
29
+ #ifndef _TEST_H_
30
+ #define _TEST_H_
31
+
32
+ #include "../src/rd.h"
33
+
34
+ #include <stdio.h>
35
+ #include <string.h>
36
+ #include <stdlib.h>
37
+ #ifndef _WIN32
38
+ #include <unistd.h>
39
+ #endif
40
+ #include <errno.h>
41
+ #include <assert.h>
42
+ #include <time.h>
43
+ #include <ctype.h>
44
+
45
+ #if HAVE_GETRUSAGE
46
+ #include <sys/time.h>
47
+ #include <sys/resource.h>
48
+ #endif
49
+
50
+ #include "rdkafka.h"
51
+ #include "rdkafka_mock.h"
52
+ #include "tinycthread.h"
53
+ #include "rdlist.h"
54
+
55
+ #if WITH_SOCKEM
56
+ #include "sockem.h"
57
+ #endif
58
+
59
+ #include "testshared.h"
60
+ #ifdef _WIN32
61
+ #define sscanf(...) sscanf_s(__VA_ARGS__)
62
+ #endif
63
+
64
+ /**
65
+ * Test output is controlled through "TEST_LEVEL=N" environemnt variable.
66
+ * N < 2: TEST_SAY() is quiet.
67
+ */
68
+
69
+ extern int test_seed;
70
+ extern char test_mode[64];
71
+ extern RD_TLS struct test *test_curr;
72
+ extern int test_assert_on_fail;
73
+ extern int tests_running_cnt;
74
+ extern int test_concurrent_max;
75
+ extern int test_rusage;
76
+ extern double test_rusage_cpu_calibration;
77
+ extern double test_timeout_multiplier;
78
+ extern int test_session_timeout_ms; /* Group session timeout */
79
+ extern int test_flags;
80
+ extern int test_neg_flags;
81
+ extern int test_idempotent_producer;
82
+
83
+ extern mtx_t test_mtx;
84
+
85
+ #define TEST_LOCK() mtx_lock(&test_mtx)
86
+ #define TEST_UNLOCK() mtx_unlock(&test_mtx)
87
+
88
+
89
+ /* Forward decl */
90
+ typedef struct test_msgver_s test_msgver_t;
91
+
92
+
93
+ /** @struct Resource usage thresholds */
94
+ struct rusage_thres {
95
+ double ucpu; /**< Max User CPU in percentage */
96
+ double scpu; /**< Max Sys CPU in percentage */
97
+ double rss; /**< Max RSS (memory) increase in MB */
98
+ int ctxsw; /**< Max number of voluntary context switches, i.e.
99
+ * syscalls. */
100
+ };
101
+
102
+ typedef enum {
103
+ TEST_NOT_STARTED,
104
+ TEST_SKIPPED,
105
+ TEST_RUNNING,
106
+ TEST_PASSED,
107
+ TEST_FAILED,
108
+ } test_state_t;
109
+
110
+ struct test {
111
+ /**
112
+ * Setup
113
+ */
114
+ const char *name; /**< e.g. Same as filename minus extension */
115
+ int (*mainfunc)(int argc, char **argv); /**< test's main func */
116
+ const int flags; /**< Test flags */
117
+ #define TEST_F_LOCAL 0x1 /**< Test is local, no broker requirement */
118
+ #define TEST_F_KNOWN_ISSUE \
119
+ 0x2 /**< Known issue, can fail without affecting \
120
+ * total test run status. */
121
+ #define TEST_F_MANUAL \
122
+ 0x4 /**< Manual test, only started when specifically \
123
+ * stated */
124
+ #define TEST_F_SOCKEM 0x8 /**< Test requires socket emulation. */
125
+ int minver; /**< Limit tests to broker version range. */
126
+ int maxver;
127
+
128
+ const char *extra; /**< Extra information to print in test_summary. */
129
+
130
+ const char *scenario; /**< Test scenario */
131
+
132
+ char *
133
+ *report_arr; /**< Test-specific reporting, JSON array of objects. */
134
+ int report_cnt;
135
+ int report_size;
136
+
137
+ rd_bool_t ignore_dr_err; /**< Ignore delivery report errors */
138
+ rd_kafka_resp_err_t exp_dr_err; /* Expected error in test_dr_cb */
139
+ rd_kafka_msg_status_t exp_dr_status; /**< Expected delivery status,
140
+ * or -1 for not checking. */
141
+ int produce_sync; /**< test_produce_sync() call in action */
142
+ rd_kafka_resp_err_t produce_sync_err; /**< DR error */
143
+ test_msgver_t *dr_mv; /**< MsgVer that delivered messages will be
144
+ * added to (if not NULL).
145
+ * Must be set and freed by test. */
146
+
147
+ /**
148
+ * Runtime
149
+ */
150
+ thrd_t thrd;
151
+ int64_t start;
152
+ int64_t duration;
153
+ FILE *stats_fp;
154
+ int64_t timeout;
155
+ test_state_t state;
156
+ int failcnt; /**< Number of failures, useful with FAIL_LATER */
157
+ char failstr[512 + 1]; /**< First test failure reason */
158
+ char subtest[400]; /**< Current subtest, if any */
159
+ test_timing_t subtest_duration; /**< Subtest duration timing */
160
+ rd_bool_t subtest_quick; /**< Subtest is marked as QUICK */
161
+
162
+ #if WITH_SOCKEM
163
+ rd_list_t sockets;
164
+ int (*connect_cb)(struct test *test, sockem_t *skm, const char *id);
165
+ #endif
166
+ int (*is_fatal_cb)(rd_kafka_t *rk,
167
+ rd_kafka_resp_err_t err,
168
+ const char *reason);
169
+
170
+ /**< Resource usage thresholds */
171
+ struct rusage_thres rusage_thres; /**< Usage thresholds */
172
+ #if HAVE_GETRUSAGE
173
+ struct rusage rusage; /**< Monitored process CPU/mem usage */
174
+ #endif
175
+ };
176
+
177
+
178
+ #ifdef _WIN32
179
+ #define TEST_F_KNOWN_ISSUE_WIN32 TEST_F_KNOWN_ISSUE
180
+ #else
181
+ #define TEST_F_KNOWN_ISSUE_WIN32 0
182
+ #endif
183
+
184
+ #ifdef __APPLE__
185
+ #define TEST_F_KNOWN_ISSUE_OSX TEST_F_KNOWN_ISSUE
186
+ #else
187
+ #define TEST_F_KNOWN_ISSUE_OSX 0
188
+ #endif
189
+
190
+
191
+ #define TEST_SAY0(...) fprintf(stderr, __VA_ARGS__)
192
+ #define TEST_SAYL(LVL, ...) \
193
+ do { \
194
+ if (test_level >= LVL) { \
195
+ fprintf( \
196
+ stderr, "\033[36m[%-28s/%7.3fs] ", \
197
+ test_curr->name, \
198
+ test_curr->start \
199
+ ? ((float)(test_clock() - test_curr->start) / \
200
+ 1000000.0f) \
201
+ : 0); \
202
+ fprintf(stderr, __VA_ARGS__); \
203
+ fprintf(stderr, "\033[0m"); \
204
+ } \
205
+ } while (0)
206
+ #define TEST_SAY(...) TEST_SAYL(2, __VA_ARGS__)
207
+
208
+ /**
209
+ * Append JSON object (as string) to this tests' report array.
210
+ */
211
+ #define TEST_REPORT(...) test_report_add(test_curr, __VA_ARGS__)
212
+
213
+
214
+
215
+ static RD_INLINE RD_UNUSED void rtrim(char *str) {
216
+ size_t len = strlen(str);
217
+ char *s;
218
+
219
+ if (len == 0)
220
+ return;
221
+
222
+ s = str + len - 1;
223
+ while (isspace((int)*s)) {
224
+ *s = '\0';
225
+ s--;
226
+ }
227
+ }
228
+
229
+ /* Skip the current test. Argument is textual reason (printf format) */
230
+ #define TEST_SKIP(...) \
231
+ do { \
232
+ TEST_WARN("SKIPPING TEST: " __VA_ARGS__); \
233
+ TEST_LOCK(); \
234
+ test_curr->state = TEST_SKIPPED; \
235
+ if (!*test_curr->failstr) { \
236
+ rd_snprintf(test_curr->failstr, \
237
+ sizeof(test_curr->failstr), __VA_ARGS__); \
238
+ rtrim(test_curr->failstr); \
239
+ } \
240
+ TEST_UNLOCK(); \
241
+ } while (0)
242
+
243
+ #define TEST_SKIP_MOCK_CLUSTER(RET) \
244
+ if (test_needs_auth()) { \
245
+ TEST_SKIP("Mock cluster does not support SSL/SASL\n"); \
246
+ return RET; \
247
+ }
248
+
249
+ void test_conf_init(rd_kafka_conf_t **conf,
250
+ rd_kafka_topic_conf_t **topic_conf,
251
+ int timeout);
252
+
253
+
254
+ typedef struct test_conf_log_interceptor_s test_conf_log_interceptor_t;
255
+
256
+ test_conf_log_interceptor_t *
257
+ test_conf_set_log_interceptor(rd_kafka_conf_t *conf,
258
+ void (*log_cb)(const rd_kafka_t *rk,
259
+ int level,
260
+ const char *fac,
261
+ const char *buf),
262
+ const char **debug_contexts);
263
+
264
+ void test_msg_fmt(char *dest,
265
+ size_t dest_size,
266
+ uint64_t testid,
267
+ int32_t partition,
268
+ int msgid);
269
+ void test_msg_parse0(const char *func,
270
+ int line,
271
+ uint64_t testid,
272
+ rd_kafka_message_t *rkmessage,
273
+ int32_t exp_partition,
274
+ int *msgidp);
275
+ #define test_msg_parse(testid, rkmessage, exp_partition, msgidp) \
276
+ test_msg_parse0(__FUNCTION__, __LINE__, testid, rkmessage, \
277
+ exp_partition, msgidp)
278
+
279
+
280
+ static RD_INLINE int jitter(int low, int high) RD_UNUSED;
281
+ static RD_INLINE int jitter(int low, int high) {
282
+ return (low + (rand() % ((high - low) + 1)));
283
+ }
284
+
285
+
286
+
287
+ /******************************************************************************
288
+ *
289
+ * Helpers
290
+ *
291
+ ******************************************************************************/
292
+
293
+
294
+
295
+ /****************************************************************
296
+ * Message verification services *
297
+ * *
298
+ * *
299
+ * *
300
+ ****************************************************************/
301
+
302
+
303
+ /**
304
+ * A test_msgver_t is first fed with messages from any number of
305
+ * topics and partitions, it is then checked for expected messages, such as:
306
+ * - all messages received, based on message payload information.
307
+ * - messages received in order
308
+ * - EOF
309
+ */
310
+ struct test_msgver_s {
311
+ struct test_mv_p **p; /* Partitions array */
312
+ int p_cnt; /* Partition count */
313
+ int p_size; /* p size */
314
+ int msgcnt; /* Total message count */
315
+ uint64_t testid; /* Only accept messages for this testid */
316
+ rd_bool_t ignore_eof; /* Don't end PARTITION_EOF messages */
317
+
318
+ struct test_msgver_s *fwd; /* Also forward add_msg() to this mv */
319
+
320
+ int log_cnt; /* Current number of warning logs */
321
+ int log_max; /* Max warning logs before suppressing. */
322
+ int log_suppr_cnt; /* Number of suppressed log messages. */
323
+
324
+ const char *msgid_hdr; /**< msgid string is in header by this name,
325
+ * rather than in the payload (default). */
326
+ }; /* test_msgver_t; */
327
+
328
+ /* Message */
329
+ struct test_mv_m {
330
+ int64_t offset; /* Message offset */
331
+ int msgid; /* Message id */
332
+ int64_t timestamp; /* Message timestamp */
333
+ int32_t broker_id; /* Message broker id */
334
+ };
335
+
336
+
337
+ /* Message vector */
338
+ struct test_mv_mvec {
339
+ struct test_mv_m *m;
340
+ int cnt;
341
+ int size; /* m[] size */
342
+ };
343
+
344
+ /* Partition */
345
+ struct test_mv_p {
346
+ char *topic;
347
+ int32_t partition;
348
+ struct test_mv_mvec mvec;
349
+ int64_t eof_offset;
350
+ };
351
+
352
+ /* Verification state */
353
+ struct test_mv_vs {
354
+ int msg_base;
355
+ int exp_cnt;
356
+
357
+ /* used by verify_range */
358
+ int msgid_min;
359
+ int msgid_max;
360
+ int64_t timestamp_min;
361
+ int64_t timestamp_max;
362
+
363
+ /* used by verify_broker_id */
364
+ int32_t broker_id;
365
+
366
+ struct test_mv_mvec mvec;
367
+
368
+ /* Correct msgver for comparison */
369
+ test_msgver_t *corr;
370
+ };
371
+
372
+
373
+ void test_msgver_init(test_msgver_t *mv, uint64_t testid);
374
+ void test_msgver_clear(test_msgver_t *mv);
375
+ void test_msgver_ignore_eof(test_msgver_t *mv);
376
+ int test_msgver_add_msg00(const char *func,
377
+ int line,
378
+ const char *clientname,
379
+ test_msgver_t *mv,
380
+ uint64_t testid,
381
+ const char *topic,
382
+ int32_t partition,
383
+ int64_t offset,
384
+ int64_t timestamp,
385
+ int32_t broker_id,
386
+ rd_kafka_resp_err_t err,
387
+ int msgnum);
388
+ int test_msgver_add_msg0(const char *func,
389
+ int line,
390
+ const char *clientname,
391
+ test_msgver_t *mv,
392
+ const rd_kafka_message_t *rkmessage,
393
+ const char *override_topic);
394
+ #define test_msgver_add_msg(rk, mv, rkm) \
395
+ test_msgver_add_msg0(__FUNCTION__, __LINE__, rd_kafka_name(rk), mv, \
396
+ rkm, NULL)
397
+
398
+ /**
399
+ * Flags to indicate what to verify.
400
+ */
401
+ #define TEST_MSGVER_ORDER 0x1 /* Order */
402
+ #define TEST_MSGVER_DUP 0x2 /* Duplicates */
403
+ #define TEST_MSGVER_RANGE 0x4 /* Range of messages */
404
+
405
+ #define TEST_MSGVER_ALL 0xf /* All verifiers */
406
+
407
+ #define TEST_MSGVER_BY_MSGID 0x10000 /* Verify by msgid (unique in testid) */
408
+ #define TEST_MSGVER_BY_OFFSET \
409
+ 0x20000 /* Verify by offset (unique in partition)*/
410
+ #define TEST_MSGVER_BY_TIMESTAMP 0x40000 /* Verify by timestamp range */
411
+ #define TEST_MSGVER_BY_BROKER_ID 0x80000 /* Verify by broker id */
412
+
413
+ #define TEST_MSGVER_SUBSET \
414
+ 0x100000 /* verify_compare: allow correct mv to be \
415
+ * a subset of mv. */
416
+
417
+ /* Only test per partition, not across all messages received on all partitions.
418
+ * This is useful when doing incremental verifications with multiple partitions
419
+ * and the total number of messages has not been received yet.
420
+ * Can't do range check here since messages may be spread out on multiple
421
+ * partitions and we might just have read a few partitions. */
422
+ #define TEST_MSGVER_PER_PART \
423
+ ((TEST_MSGVER_ALL & ~TEST_MSGVER_RANGE) | TEST_MSGVER_BY_MSGID | \
424
+ TEST_MSGVER_BY_OFFSET)
425
+
426
+ /* Test on all messages across all partitions.
427
+ * This can only be used to check with msgid, not offset since that
428
+ * is partition local. */
429
+ #define TEST_MSGVER_ALL_PART (TEST_MSGVER_ALL | TEST_MSGVER_BY_MSGID)
430
+
431
+
432
+ int test_msgver_verify_part0(const char *func,
433
+ int line,
434
+ const char *what,
435
+ test_msgver_t *mv,
436
+ int flags,
437
+ const char *topic,
438
+ int partition,
439
+ int msg_base,
440
+ int exp_cnt);
441
+ #define test_msgver_verify_part(what, mv, flags, topic, partition, msg_base, \
442
+ exp_cnt) \
443
+ test_msgver_verify_part0(__FUNCTION__, __LINE__, what, mv, flags, \
444
+ topic, partition, msg_base, exp_cnt)
445
+
446
+ int test_msgver_verify0(const char *func,
447
+ int line,
448
+ const char *what,
449
+ test_msgver_t *mv,
450
+ int flags,
451
+ struct test_mv_vs vs);
452
+ #define test_msgver_verify(what, mv, flags, msgbase, expcnt) \
453
+ test_msgver_verify0( \
454
+ __FUNCTION__, __LINE__, what, mv, flags, \
455
+ (struct test_mv_vs) {.msg_base = msgbase, .exp_cnt = expcnt})
456
+
457
+
458
+ void test_msgver_verify_compare0(const char *func,
459
+ int line,
460
+ const char *what,
461
+ test_msgver_t *mv,
462
+ test_msgver_t *corr,
463
+ int flags);
464
+ #define test_msgver_verify_compare(what, mv, corr, flags) \
465
+ test_msgver_verify_compare0(__FUNCTION__, __LINE__, what, mv, corr, \
466
+ flags)
467
+
468
+ rd_kafka_t *test_create_handle(int mode, rd_kafka_conf_t *conf);
469
+
470
+ /**
471
+ * Delivery reported callback.
472
+ * Called for each message once to signal its delivery status.
473
+ */
474
+ void test_dr_msg_cb(rd_kafka_t *rk,
475
+ const rd_kafka_message_t *rkmessage,
476
+ void *opaque);
477
+
478
+ rd_kafka_t *test_create_producer(void);
479
+ rd_kafka_topic_t *
480
+ test_create_producer_topic(rd_kafka_t *rk, const char *topic, ...);
481
+ void test_wait_delivery(rd_kafka_t *rk, int *msgcounterp);
482
+ void test_produce_msgs_nowait(rd_kafka_t *rk,
483
+ rd_kafka_topic_t *rkt,
484
+ uint64_t testid,
485
+ int32_t partition,
486
+ int msg_base,
487
+ int cnt,
488
+ const char *payload,
489
+ size_t size,
490
+ int msgrate,
491
+ int *msgcounterp);
492
+ void test_produce_msgs(rd_kafka_t *rk,
493
+ rd_kafka_topic_t *rkt,
494
+ uint64_t testid,
495
+ int32_t partition,
496
+ int msg_base,
497
+ int cnt,
498
+ const char *payload,
499
+ size_t size);
500
+ void test_produce_msgs2(rd_kafka_t *rk,
501
+ const char *topic,
502
+ uint64_t testid,
503
+ int32_t partition,
504
+ int msg_base,
505
+ int cnt,
506
+ const char *payload,
507
+ size_t size);
508
+ void test_produce_msgs2_nowait(rd_kafka_t *rk,
509
+ const char *topic,
510
+ uint64_t testid,
511
+ int32_t partition,
512
+ int msg_base,
513
+ int cnt,
514
+ const char *payload,
515
+ size_t size,
516
+ int *remainsp);
517
+ void test_produce_msgs_rate(rd_kafka_t *rk,
518
+ rd_kafka_topic_t *rkt,
519
+ uint64_t testid,
520
+ int32_t partition,
521
+ int msg_base,
522
+ int cnt,
523
+ const char *payload,
524
+ size_t size,
525
+ int msgrate);
526
+ rd_kafka_resp_err_t test_produce_sync(rd_kafka_t *rk,
527
+ rd_kafka_topic_t *rkt,
528
+ uint64_t testid,
529
+ int32_t partition);
530
+
531
+ void test_produce_msgs_easy_v(const char *topic,
532
+ uint64_t testid,
533
+ int32_t partition,
534
+ int msg_base,
535
+ int cnt,
536
+ size_t size,
537
+ ...);
538
+ void test_produce_msgs_easy_multi(uint64_t testid, ...);
539
+
540
+ void test_incremental_rebalance_cb(rd_kafka_t *rk,
541
+ rd_kafka_resp_err_t err,
542
+ rd_kafka_topic_partition_list_t *parts,
543
+ void *opaque);
544
+ void test_rebalance_cb(rd_kafka_t *rk,
545
+ rd_kafka_resp_err_t err,
546
+ rd_kafka_topic_partition_list_t *parts,
547
+ void *opaque);
548
+
549
+ rd_kafka_t *test_create_consumer(
550
+ const char *group_id,
551
+ void (*rebalance_cb)(rd_kafka_t *rk,
552
+ rd_kafka_resp_err_t err,
553
+ rd_kafka_topic_partition_list_t *partitions,
554
+ void *opaque),
555
+ rd_kafka_conf_t *conf,
556
+ rd_kafka_topic_conf_t *default_topic_conf);
557
+ rd_kafka_topic_t *test_create_consumer_topic(rd_kafka_t *rk, const char *topic);
558
+ rd_kafka_topic_t *
559
+ test_create_topic_object(rd_kafka_t *rk, const char *topic, ...);
560
+ void test_consumer_start(const char *what,
561
+ rd_kafka_topic_t *rkt,
562
+ int32_t partition,
563
+ int64_t start_offset);
564
+ void test_consumer_stop(const char *what,
565
+ rd_kafka_topic_t *rkt,
566
+ int32_t partition);
567
+ void test_consumer_seek(const char *what,
568
+ rd_kafka_topic_t *rkt,
569
+ int32_t partition,
570
+ int64_t offset);
571
+
572
+ #define TEST_NO_SEEK -1
573
+ int64_t test_consume_msgs(const char *what,
574
+ rd_kafka_topic_t *rkt,
575
+ uint64_t testid,
576
+ int32_t partition,
577
+ int64_t offset,
578
+ int exp_msg_base,
579
+ int exp_cnt,
580
+ int parse_fmt);
581
+
582
+
583
+ void test_verify_rkmessage0(const char *func,
584
+ int line,
585
+ rd_kafka_message_t *rkmessage,
586
+ uint64_t testid,
587
+ int32_t partition,
588
+ int msgnum);
589
+ #define test_verify_rkmessage(rkmessage, testid, partition, msgnum) \
590
+ test_verify_rkmessage0(__FUNCTION__, __LINE__, rkmessage, testid, \
591
+ partition, msgnum)
592
+
593
+ void test_consumer_subscribe(rd_kafka_t *rk, const char *topic);
594
+
595
+ void test_consumer_subscribe_multi(rd_kafka_t *rk, int topic_count, ...);
596
+
597
+ void test_consume_msgs_easy_mv0(const char *group_id,
598
+ const char *topic,
599
+ rd_bool_t txn,
600
+ int32_t partition,
601
+ uint64_t testid,
602
+ int exp_eofcnt,
603
+ int exp_msgcnt,
604
+ rd_kafka_topic_conf_t *tconf,
605
+ test_msgver_t *mv);
606
+
607
+ #define test_consume_msgs_easy_mv(group_id, topic, partition, testid, \
608
+ exp_eofcnt, exp_msgcnt, tconf, mv) \
609
+ test_consume_msgs_easy_mv0(group_id, topic, rd_false /*not-txn*/, \
610
+ partition, testid, exp_eofcnt, exp_msgcnt, \
611
+ tconf, mv)
612
+
613
+ void test_consume_msgs_easy(const char *group_id,
614
+ const char *topic,
615
+ uint64_t testid,
616
+ int exp_eofcnt,
617
+ int exp_msgcnt,
618
+ rd_kafka_topic_conf_t *tconf);
619
+
620
+ void test_consume_txn_msgs_easy(const char *group_id,
621
+ const char *topic,
622
+ uint64_t testid,
623
+ int exp_eofcnt,
624
+ int exp_msgcnt,
625
+ rd_kafka_topic_conf_t *tconf);
626
+
627
+ void test_consumer_poll_no_msgs(const char *what,
628
+ rd_kafka_t *rk,
629
+ uint64_t testid,
630
+ int timeout_ms);
631
+ void test_consumer_poll_expect_err(rd_kafka_t *rk,
632
+ uint64_t testid,
633
+ int timeout_ms,
634
+ rd_kafka_resp_err_t err);
635
+ int test_consumer_poll_once(rd_kafka_t *rk, test_msgver_t *mv, int timeout_ms);
636
+ int test_consumer_poll_exact_timeout(const char *what,
637
+ rd_kafka_t *rk,
638
+ uint64_t testid,
639
+ int exp_eof_cnt,
640
+ int exp_msg_base,
641
+ int exp_cnt,
642
+ rd_bool_t exact,
643
+ test_msgver_t *mv,
644
+ int timeout_ms);
645
+ int test_consumer_poll_exact(const char *what,
646
+ rd_kafka_t *rk,
647
+ uint64_t testid,
648
+ int exp_eof_cnt,
649
+ int exp_msg_base,
650
+ int exp_cnt,
651
+ rd_bool_t exact,
652
+ test_msgver_t *mv);
653
+ int test_consumer_poll(const char *what,
654
+ rd_kafka_t *rk,
655
+ uint64_t testid,
656
+ int exp_eof_cnt,
657
+ int exp_msg_base,
658
+ int exp_cnt,
659
+ test_msgver_t *mv);
660
+ int test_consumer_poll_timeout(const char *what,
661
+ rd_kafka_t *rk,
662
+ uint64_t testid,
663
+ int exp_eof_cnt,
664
+ int exp_msg_base,
665
+ int exp_cnt,
666
+ test_msgver_t *mv,
667
+ int timeout_ms);
668
+
669
+ void test_consumer_wait_assignment(rd_kafka_t *rk, rd_bool_t do_poll);
670
+ void test_consumer_verify_assignment0(const char *func,
671
+ int line,
672
+ rd_kafka_t *rk,
673
+ int fail_immediately,
674
+ ...);
675
+ #define test_consumer_verify_assignment(rk, fail_immediately, ...) \
676
+ test_consumer_verify_assignment0(__FUNCTION__, __LINE__, rk, \
677
+ fail_immediately, __VA_ARGS__)
678
+
679
+ rd_bool_t test_consumer_verify_assignment_topic_partition_list0(
680
+ const char *func,
681
+ int line,
682
+ rd_kafka_t *rk,
683
+ const rd_kafka_topic_partition_list_t *expected_assignment);
684
+ #define test_consumer_verify_assignment_topic_partition_list( \
685
+ rk, expected_assignment) \
686
+ test_consumer_verify_assignment_topic_partition_list0( \
687
+ __FUNCTION__, __LINE__, rk, expected_assignment)
688
+
689
+ void test_consumer_wait_assignment_topic_partition_list0(
690
+ const char *func,
691
+ int line,
692
+ rd_kafka_t *rk,
693
+ rd_bool_t do_poll,
694
+ const rd_kafka_topic_partition_list_t *expected_assignment,
695
+ int timeout_ms);
696
+ #define test_consumer_wait_assignment_topic_partition_list( \
697
+ rk, do_poll, expected_assignment, timeout_ms) \
698
+ test_consumer_wait_assignment_topic_partition_list0( \
699
+ __FUNCTION__, __LINE__, rk, do_poll, expected_assignment, \
700
+ timeout_ms)
701
+
702
+ void test_consumer_assign(const char *what,
703
+ rd_kafka_t *rk,
704
+ rd_kafka_topic_partition_list_t *parts);
705
+ void test_consumer_incremental_assign(const char *what,
706
+ rd_kafka_t *rk,
707
+ rd_kafka_topic_partition_list_t *parts);
708
+ void test_consumer_unassign(const char *what, rd_kafka_t *rk);
709
+ void test_consumer_incremental_unassign(const char *what,
710
+ rd_kafka_t *rk,
711
+ rd_kafka_topic_partition_list_t *parts);
712
+ void test_consumer_assign_by_rebalance_protocol(
713
+ const char *what,
714
+ rd_kafka_t *rk,
715
+ rd_kafka_topic_partition_list_t *parts);
716
+ void test_consumer_unassign_by_rebalance_protocol(
717
+ const char *what,
718
+ rd_kafka_t *rk,
719
+ rd_kafka_topic_partition_list_t *parts);
720
+ void test_consumer_assign_partition(const char *what,
721
+ rd_kafka_t *rk,
722
+ const char *topic,
723
+ int32_t partition,
724
+ int64_t offset);
725
+ void test_consumer_pause_resume_partition(rd_kafka_t *rk,
726
+ const char *topic,
727
+ int32_t partition,
728
+ rd_bool_t pause);
729
+
730
+ void test_consumer_close(rd_kafka_t *rk);
731
+
732
+ void test_flush(rd_kafka_t *rk, int timeout_ms);
733
+
734
+ int test_is_forbidden_conf_group_protocol_consumer(const char *name);
735
+ void test_conf_set(rd_kafka_conf_t *conf, const char *name, const char *val);
736
+ char *test_topic_conf_get(const rd_kafka_topic_conf_t *tconf, const char *name);
737
+ int test_conf_match(rd_kafka_conf_t *conf, const char *name, const char *val);
738
+ void test_topic_conf_set(rd_kafka_topic_conf_t *tconf,
739
+ const char *name,
740
+ const char *val);
741
+ void test_any_conf_set(rd_kafka_conf_t *conf,
742
+ rd_kafka_topic_conf_t *tconf,
743
+ const char *name,
744
+ const char *val);
745
+
746
+ rd_kafka_topic_partition_list_t *test_topic_partitions(int cnt, ...);
747
+ void test_print_partition_list(
748
+ const rd_kafka_topic_partition_list_t *partitions);
749
+ int test_partition_list_cmp(rd_kafka_topic_partition_list_t *al,
750
+ rd_kafka_topic_partition_list_t *bl);
751
+ int test_partition_list_and_offsets_cmp(rd_kafka_topic_partition_list_t *al,
752
+ rd_kafka_topic_partition_list_t *bl);
753
+
754
+ void test_kafka_topics(const char *fmt, ...);
755
+ void test_admin_create_topic(rd_kafka_t *use_rk,
756
+ const char *topicname,
757
+ int partition_cnt,
758
+ int replication_factor,
759
+ const char **configs);
760
+ void test_create_topic(rd_kafka_t *use_rk,
761
+ const char *topicname,
762
+ int partition_cnt,
763
+ int replication_factor);
764
+ void test_create_topic_wait_exists(rd_kafka_t *use_rk,
765
+ const char *topicname,
766
+ int partition_cnt,
767
+ int replication_factor,
768
+ int timeout);
769
+ rd_kafka_resp_err_t test_auto_create_topic_rkt(rd_kafka_t *rk,
770
+ rd_kafka_topic_t *rkt,
771
+ int timeout_ms);
772
+ rd_kafka_resp_err_t
773
+ test_auto_create_topic(rd_kafka_t *rk, const char *name, int timeout_ms);
774
+ int test_check_auto_create_topic(void);
775
+
776
+ void test_create_partitions(rd_kafka_t *use_rk,
777
+ const char *topicname,
778
+ int new_partition_cnt);
779
+
780
+ int test_get_partition_count(rd_kafka_t *rk,
781
+ const char *topicname,
782
+ int timeout_ms);
783
+
784
+ char *tsprintf(const char *fmt, ...) RD_FORMAT(printf, 1, 2);
785
+
786
+ void test_report_add(struct test *test, const char *fmt, ...);
787
+ int test_can_create_topics(int skip);
788
+
789
+ rd_kafka_event_t *test_wait_event(rd_kafka_queue_t *eventq,
790
+ rd_kafka_event_type_t event_type,
791
+ int timeout_ms);
792
+
793
+ void test_prepare_msg(uint64_t testid,
794
+ int32_t partition,
795
+ int msg_id,
796
+ char *val,
797
+ size_t val_size,
798
+ char *key,
799
+ size_t key_size);
800
+
801
+ #if WITH_SOCKEM
802
+ void test_socket_enable(rd_kafka_conf_t *conf);
803
+ void *test_socket_find(struct test *test, sockem_t *skm);
804
+ void test_socket_close_all(struct test *test, int reinit);
805
+ int test_socket_sockem_set_all(const char *key, int val);
806
+ void test_socket_sockem_set(int s, const char *key, int value);
807
+ #endif
808
+
809
+ void test_headers_dump(const char *what,
810
+ int lvl,
811
+ const rd_kafka_headers_t *hdrs);
812
+
813
+ int32_t *test_get_broker_ids(rd_kafka_t *use_rk, size_t *cntp);
814
+
815
+ char *test_get_broker_config_entry(rd_kafka_t *use_rk,
816
+ int32_t broker_id,
817
+ const char *key);
818
+
819
+ void test_wait_metadata_update(rd_kafka_t *rk,
820
+ rd_kafka_metadata_topic_t *topics,
821
+ size_t topic_cnt,
822
+ rd_kafka_metadata_topic_t *not_topics,
823
+ size_t not_topic_cnt,
824
+ int tmout);
825
+
826
+ rd_kafka_event_t *test_wait_admin_result(rd_kafka_queue_t *q,
827
+ rd_kafka_event_type_t evtype,
828
+ int tmout);
829
+
830
+ rd_kafka_resp_err_t test_wait_topic_admin_result(rd_kafka_queue_t *q,
831
+ rd_kafka_event_type_t evtype,
832
+ rd_kafka_event_t **retevent,
833
+ int tmout);
834
+
835
+ rd_kafka_resp_err_t test_CreateTopics_simple(rd_kafka_t *rk,
836
+ rd_kafka_queue_t *useq,
837
+ char **topics,
838
+ size_t topic_cnt,
839
+ int num_partitions,
840
+ void *opaque);
841
+ rd_kafka_resp_err_t test_CreatePartitions_simple(rd_kafka_t *rk,
842
+ rd_kafka_queue_t *useq,
843
+ const char *topic,
844
+ size_t total_part_cnt,
845
+ void *opaque);
846
+
847
+ rd_kafka_resp_err_t test_DeleteTopics_simple(rd_kafka_t *rk,
848
+ rd_kafka_queue_t *useq,
849
+ char **topics,
850
+ size_t topic_cnt,
851
+ void *opaque);
852
+
853
+ rd_kafka_resp_err_t test_AlterConfigs_simple(rd_kafka_t *rk,
854
+ rd_kafka_ResourceType_t restype,
855
+ const char *resname,
856
+ const char **configs,
857
+ size_t config_cnt);
858
+
859
+ rd_kafka_resp_err_t
860
+ test_IncrementalAlterConfigs_simple(rd_kafka_t *rk,
861
+ rd_kafka_ResourceType_t restype,
862
+ const char *resname,
863
+ const char **configs,
864
+ size_t config_cnt);
865
+
866
+ rd_kafka_resp_err_t test_DeleteGroups_simple(rd_kafka_t *rk,
867
+ rd_kafka_queue_t *useq,
868
+ char **groups,
869
+ size_t group_cnt,
870
+ void *opaque);
871
+
872
+ rd_kafka_resp_err_t
873
+ test_DeleteRecords_simple(rd_kafka_t *rk,
874
+ rd_kafka_queue_t *useq,
875
+ const rd_kafka_topic_partition_list_t *offsets,
876
+ void *opaque);
877
+
878
+ rd_kafka_resp_err_t test_DeleteConsumerGroupOffsets_simple(
879
+ rd_kafka_t *rk,
880
+ rd_kafka_queue_t *useq,
881
+ const char *group_id,
882
+ const rd_kafka_topic_partition_list_t *offsets,
883
+ void *opaque);
884
+
885
+ rd_kafka_resp_err_t test_CreateAcls_simple(rd_kafka_t *rk,
886
+ rd_kafka_queue_t *useq,
887
+ rd_kafka_AclBinding_t **acls,
888
+ size_t acl_cnt,
889
+ void *opaque);
890
+
891
+ rd_kafka_resp_err_t
892
+ test_DeleteAcls_simple(rd_kafka_t *rk,
893
+ rd_kafka_queue_t *useq,
894
+ rd_kafka_AclBindingFilter_t **acl_filters,
895
+ size_t acl_filters_cnt,
896
+ void *opaque);
897
+
898
+ rd_kafka_resp_err_t test_delete_all_test_topics(int timeout_ms);
899
+
900
+ void test_mock_cluster_destroy(rd_kafka_mock_cluster_t *mcluster);
901
+ rd_kafka_mock_cluster_t *test_mock_cluster_new(int broker_cnt,
902
+ const char **bootstraps);
903
+
904
+ size_t test_mock_get_matching_request_cnt(
905
+ rd_kafka_mock_cluster_t *mcluster,
906
+ rd_bool_t (*match)(rd_kafka_mock_request_t *request, void *opaque),
907
+ void *opaque);
908
+
909
+ size_t test_mock_wait_matching_requests(
910
+ rd_kafka_mock_cluster_t *mcluster,
911
+ size_t num,
912
+ int confidence_interval_ms,
913
+ rd_bool_t (*match)(rd_kafka_mock_request_t *request, void *opaque),
914
+ void *opaque);
915
+
916
+ void test_mock_cluster_member_assignment(rd_kafka_mock_cluster_t *mcluster,
917
+ int member_cnt,
918
+ ...);
919
+
920
+ int test_error_is_not_fatal_cb(rd_kafka_t *rk,
921
+ rd_kafka_resp_err_t err,
922
+ const char *reason);
923
+
924
+
925
+ const char *test_consumer_group_protocol();
926
+
927
+ int test_consumer_group_protocol_classic();
928
+
929
+ /**
930
+ * @brief Calls rdkafka function (with arguments)
931
+ * and checks its return value (must be rd_kafka_resp_err_t) for
932
+ * error, in which case the test fails.
933
+ * Also times the call.
934
+ *
935
+ * @remark The trailing __ makes calling code easier to read.
936
+ */
937
+ #define TEST_CALL__(FUNC_W_ARGS) \
938
+ do { \
939
+ test_timing_t _timing; \
940
+ const char *_desc = RD_STRINGIFY(FUNC_W_ARGS); \
941
+ rd_kafka_resp_err_t _err; \
942
+ TIMING_START(&_timing, "%s", _desc); \
943
+ TEST_SAYL(3, "Begin call %s\n", _desc); \
944
+ _err = FUNC_W_ARGS; \
945
+ TIMING_STOP(&_timing); \
946
+ if (!_err) \
947
+ break; \
948
+ if (strstr(_desc, "errstr")) \
949
+ TEST_FAIL("%s failed: %s: %s\n", _desc, \
950
+ rd_kafka_err2name(_err), errstr); \
951
+ else \
952
+ TEST_FAIL("%s failed: %s\n", _desc, \
953
+ rd_kafka_err2str(_err)); \
954
+ } while (0)
955
+
956
+
957
+ /**
958
+ * @brief Same as TEST_CALL__() but expects an rd_kafka_error_t * return type.
959
+ */
960
+ #define TEST_CALL_ERROR__(FUNC_W_ARGS) \
961
+ do { \
962
+ test_timing_t _timing; \
963
+ const char *_desc = RD_STRINGIFY(FUNC_W_ARGS); \
964
+ const rd_kafka_error_t *_error; \
965
+ TIMING_START(&_timing, "%s", _desc); \
966
+ TEST_SAYL(3, "Begin call %s\n", _desc); \
967
+ _error = FUNC_W_ARGS; \
968
+ TIMING_STOP(&_timing); \
969
+ if (!_error) \
970
+ break; \
971
+ TEST_FAIL("%s failed: %s\n", _desc, \
972
+ rd_kafka_error_string(_error)); \
973
+ } while (0)
974
+
975
+ /**
976
+ * @brief Same as TEST_CALL__() but expects an rd_kafka_resp_err_t return type
977
+ * without errstr.
978
+ */
979
+ #define TEST_CALL_ERR__(FUNC_W_ARGS) \
980
+ do { \
981
+ test_timing_t _timing; \
982
+ const char *_desc = RD_STRINGIFY(FUNC_W_ARGS); \
983
+ rd_kafka_resp_err_t _err; \
984
+ TIMING_START(&_timing, "%s", _desc); \
985
+ TEST_SAYL(3, "Begin call %s\n", _desc); \
986
+ _err = FUNC_W_ARGS; \
987
+ TIMING_STOP(&_timing); \
988
+ if (!_err) \
989
+ break; \
990
+ TEST_FAIL("%s failed: %s\n", _desc, rd_kafka_err2str(_err)); \
991
+ } while (0)
992
+
993
+
994
+ /**
995
+ * @brief Print a rich error_t object in all its glory. NULL is ok.
996
+ *
997
+ * @param ... Is a prefix format-string+args that is printed with TEST_SAY()
998
+ * prior to the error details. E.g., "commit() returned: ".
999
+ * A newline is automatically appended.
1000
+ */
1001
+ #define TEST_SAY_ERROR(ERROR, ...) \
1002
+ do { \
1003
+ rd_kafka_error_t *_e = (ERROR); \
1004
+ TEST_SAY(__VA_ARGS__); \
1005
+ if (!_e) { \
1006
+ TEST_SAY0("No error" _C_CLR "\n"); \
1007
+ break; \
1008
+ } \
1009
+ if (rd_kafka_error_is_fatal(_e)) \
1010
+ TEST_SAY0(_C_RED "FATAL "); \
1011
+ if (rd_kafka_error_is_retriable(_e)) \
1012
+ TEST_SAY0("Retriable "); \
1013
+ if (rd_kafka_error_txn_requires_abort(_e)) \
1014
+ TEST_SAY0("TxnRequiresAbort "); \
1015
+ TEST_SAY0("Error: %s: %s" _C_CLR "\n", \
1016
+ rd_kafka_error_name(_e), rd_kafka_error_string(_e)); \
1017
+ } while (0)
1018
+
1019
+ /**
1020
+ * @name rusage.c
1021
+ * @{
1022
+ */
1023
+ void test_rusage_start(struct test *test);
1024
+ int test_rusage_stop(struct test *test, double duration);
1025
+
1026
+ /**@}*/
1027
+
1028
+ #endif /* _TEST_H_ */