@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.
- package/LICENSE.txt +20 -0
- package/README.md +636 -0
- package/binding.gyp +154 -0
- package/deps/librdkafka/.clang-format +136 -0
- package/deps/librdkafka/.clang-format-cpp +103 -0
- package/deps/librdkafka/.dir-locals.el +10 -0
- package/deps/librdkafka/.formatignore +33 -0
- package/deps/librdkafka/.gdbmacros +19 -0
- package/deps/librdkafka/.github/CODEOWNERS +1 -0
- package/deps/librdkafka/.github/ISSUE_TEMPLATE +34 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +378 -0
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +2208 -0
- package/deps/librdkafka/CMakeLists.txt +291 -0
- package/deps/librdkafka/CODE_OF_CONDUCT.md +46 -0
- package/deps/librdkafka/CONFIGURATION.md +209 -0
- package/deps/librdkafka/CONTRIBUTING.md +431 -0
- package/deps/librdkafka/Doxyfile +2375 -0
- package/deps/librdkafka/INTRODUCTION.md +2481 -0
- package/deps/librdkafka/LICENSE +26 -0
- package/deps/librdkafka/LICENSE.cjson +22 -0
- package/deps/librdkafka/LICENSE.crc32c +28 -0
- package/deps/librdkafka/LICENSE.fnv1a +18 -0
- package/deps/librdkafka/LICENSE.hdrhistogram +27 -0
- package/deps/librdkafka/LICENSE.lz4 +26 -0
- package/deps/librdkafka/LICENSE.murmur2 +25 -0
- package/deps/librdkafka/LICENSE.nanopb +22 -0
- package/deps/librdkafka/LICENSE.opentelemetry +203 -0
- package/deps/librdkafka/LICENSE.pycrc +23 -0
- package/deps/librdkafka/LICENSE.queue +31 -0
- package/deps/librdkafka/LICENSE.regexp +5 -0
- package/deps/librdkafka/LICENSE.snappy +36 -0
- package/deps/librdkafka/LICENSE.tinycthread +26 -0
- package/deps/librdkafka/LICENSE.wingetopt +49 -0
- package/deps/librdkafka/LICENSES.txt +625 -0
- package/deps/librdkafka/Makefile +125 -0
- package/deps/librdkafka/README.md +199 -0
- package/deps/librdkafka/README.win32 +26 -0
- package/deps/librdkafka/STATISTICS.md +624 -0
- package/deps/librdkafka/configure +214 -0
- package/deps/librdkafka/configure.self +331 -0
- package/deps/librdkafka/debian/changelog +111 -0
- package/deps/librdkafka/debian/compat +1 -0
- package/deps/librdkafka/debian/control +71 -0
- package/deps/librdkafka/debian/copyright +99 -0
- package/deps/librdkafka/debian/gbp.conf +9 -0
- package/deps/librdkafka/debian/librdkafka++1.install +1 -0
- package/deps/librdkafka/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/debian/librdkafka-dev.install +9 -0
- package/deps/librdkafka/debian/librdkafka1.docs +5 -0
- package/deps/librdkafka/debian/librdkafka1.install +1 -0
- package/deps/librdkafka/debian/librdkafka1.symbols +135 -0
- package/deps/librdkafka/debian/rules +19 -0
- package/deps/librdkafka/debian/source/format +1 -0
- package/deps/librdkafka/debian/watch +2 -0
- package/deps/librdkafka/dev-conf.sh +123 -0
- package/deps/librdkafka/examples/CMakeLists.txt +79 -0
- package/deps/librdkafka/examples/Makefile +167 -0
- package/deps/librdkafka/examples/README.md +42 -0
- package/deps/librdkafka/examples/alter_consumer_group_offsets.c +338 -0
- package/deps/librdkafka/examples/consumer.c +271 -0
- package/deps/librdkafka/examples/delete_records.c +233 -0
- package/deps/librdkafka/examples/describe_cluster.c +322 -0
- package/deps/librdkafka/examples/describe_consumer_groups.c +455 -0
- package/deps/librdkafka/examples/describe_topics.c +427 -0
- package/deps/librdkafka/examples/elect_leaders.c +317 -0
- package/deps/librdkafka/examples/globals.json +11 -0
- package/deps/librdkafka/examples/idempotent_producer.c +344 -0
- package/deps/librdkafka/examples/incremental_alter_configs.c +347 -0
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +945 -0
- package/deps/librdkafka/examples/list_consumer_group_offsets.c +359 -0
- package/deps/librdkafka/examples/list_consumer_groups.c +365 -0
- package/deps/librdkafka/examples/list_offsets.c +327 -0
- package/deps/librdkafka/examples/misc.c +287 -0
- package/deps/librdkafka/examples/openssl_engine_example.cpp +248 -0
- package/deps/librdkafka/examples/producer.c +251 -0
- package/deps/librdkafka/examples/producer.cpp +228 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.c +617 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.cpp +467 -0
- package/deps/librdkafka/examples/rdkafka_consume_batch.cpp +264 -0
- package/deps/librdkafka/examples/rdkafka_example.c +853 -0
- package/deps/librdkafka/examples/rdkafka_example.cpp +679 -0
- package/deps/librdkafka/examples/rdkafka_performance.c +1781 -0
- package/deps/librdkafka/examples/transactions-older-broker.c +668 -0
- package/deps/librdkafka/examples/transactions.c +665 -0
- package/deps/librdkafka/examples/user_scram.c +491 -0
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +396 -0
- package/deps/librdkafka/lds-gen.py +73 -0
- package/deps/librdkafka/mainpage.doxy +40 -0
- package/deps/librdkafka/mklove/Makefile.base +329 -0
- package/deps/librdkafka/mklove/modules/configure.atomics +144 -0
- package/deps/librdkafka/mklove/modules/configure.base +2484 -0
- package/deps/librdkafka/mklove/modules/configure.builtin +70 -0
- package/deps/librdkafka/mklove/modules/configure.cc +186 -0
- package/deps/librdkafka/mklove/modules/configure.cxx +8 -0
- package/deps/librdkafka/mklove/modules/configure.fileversion +65 -0
- package/deps/librdkafka/mklove/modules/configure.gitversion +29 -0
- package/deps/librdkafka/mklove/modules/configure.good_cflags +18 -0
- package/deps/librdkafka/mklove/modules/configure.host +132 -0
- package/deps/librdkafka/mklove/modules/configure.lib +49 -0
- package/deps/librdkafka/mklove/modules/configure.libcurl +99 -0
- package/deps/librdkafka/mklove/modules/configure.libsasl2 +36 -0
- package/deps/librdkafka/mklove/modules/configure.libssl +147 -0
- package/deps/librdkafka/mklove/modules/configure.libzstd +58 -0
- package/deps/librdkafka/mklove/modules/configure.parseversion +95 -0
- package/deps/librdkafka/mklove/modules/configure.pic +16 -0
- package/deps/librdkafka/mklove/modules/configure.socket +20 -0
- package/deps/librdkafka/mklove/modules/configure.zlib +61 -0
- package/deps/librdkafka/mklove/modules/patches/README.md +8 -0
- package/deps/librdkafka/mklove/modules/patches/libcurl.0000-no-runtime-linking-check.patch +11 -0
- package/deps/librdkafka/mklove/modules/patches/libssl.0000-osx-rand-include-fix-OpenSSL-PR16409.patch +56 -0
- package/deps/librdkafka/packaging/RELEASE.md +319 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +38 -0
- package/deps/librdkafka/packaging/archlinux/PKGBUILD +30 -0
- package/deps/librdkafka/packaging/cmake/Config.cmake.in +37 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindLZ4.cmake +38 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindZSTD.cmake +27 -0
- package/deps/librdkafka/packaging/cmake/Modules/LICENSE.FindZstd +178 -0
- package/deps/librdkafka/packaging/cmake/README.md +38 -0
- package/deps/librdkafka/packaging/cmake/config.h.in +52 -0
- package/deps/librdkafka/packaging/cmake/parseversion.cmake +60 -0
- package/deps/librdkafka/packaging/cmake/rdkafka.pc.in +12 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_64_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/c11threads_test.c +14 -0
- package/deps/librdkafka/packaging/cmake/try_compile/crc32c_hw_test.c +27 -0
- package/deps/librdkafka/packaging/cmake/try_compile/dlopen_test.c +11 -0
- package/deps/librdkafka/packaging/cmake/try_compile/libsasl2_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_darwin_test.c +6 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_freebsd_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_gnu_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rand_r_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rdkafka_setup.cmake +122 -0
- package/deps/librdkafka/packaging/cmake/try_compile/regex_test.c +10 -0
- package/deps/librdkafka/packaging/cmake/try_compile/strndup_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_64_test.c +8 -0
- package/deps/librdkafka/packaging/cp/README.md +16 -0
- package/deps/librdkafka/packaging/cp/check_features.c +72 -0
- package/deps/librdkafka/packaging/cp/verify-deb.sh +33 -0
- package/deps/librdkafka/packaging/cp/verify-packages.sh +69 -0
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +32 -0
- package/deps/librdkafka/packaging/debian/changelog +66 -0
- package/deps/librdkafka/packaging/debian/compat +1 -0
- package/deps/librdkafka/packaging/debian/control +49 -0
- package/deps/librdkafka/packaging/debian/copyright +84 -0
- package/deps/librdkafka/packaging/debian/docs +5 -0
- package/deps/librdkafka/packaging/debian/gbp.conf +9 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.dirs +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.install +6 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka.dsc +16 -0
- package/deps/librdkafka/packaging/debian/librdkafka1-dbg.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.dirs +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.install +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postinst.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postrm.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.symbols +64 -0
- package/deps/librdkafka/packaging/debian/rules +19 -0
- package/deps/librdkafka/packaging/debian/source/format +1 -0
- package/deps/librdkafka/packaging/debian/watch +2 -0
- package/deps/librdkafka/packaging/get_version.py +21 -0
- package/deps/librdkafka/packaging/homebrew/README.md +15 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +31 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw-static.sh +52 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw.sh +21 -0
- package/deps/librdkafka/packaging/mingw-w64/export-variables.sh +13 -0
- package/deps/librdkafka/packaging/mingw-w64/run-tests.sh +6 -0
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +38 -0
- package/deps/librdkafka/packaging/nuget/README.md +84 -0
- package/deps/librdkafka/packaging/nuget/artifact.py +177 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +143 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/nugetpackage.py +278 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +448 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/release.py +167 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -0
- package/deps/librdkafka/packaging/nuget/staticpackage.py +178 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.nuspec +21 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.props +18 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.targets +19 -0
- package/deps/librdkafka/packaging/nuget/zfile/__init__.py +0 -0
- package/deps/librdkafka/packaging/nuget/zfile/zfile.py +98 -0
- package/deps/librdkafka/packaging/rpm/Makefile +92 -0
- package/deps/librdkafka/packaging/rpm/README.md +23 -0
- package/deps/librdkafka/packaging/rpm/el7-x86_64.cfg +40 -0
- package/deps/librdkafka/packaging/rpm/librdkafka.spec +118 -0
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +96 -0
- package/deps/librdkafka/packaging/rpm/tests/Makefile +25 -0
- package/deps/librdkafka/packaging/rpm/tests/README.md +8 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +42 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +56 -0
- package/deps/librdkafka/packaging/rpm/tests/test.c +77 -0
- package/deps/librdkafka/packaging/rpm/tests/test.cpp +34 -0
- package/deps/librdkafka/packaging/tools/Dockerfile +31 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +12 -0
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +64 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +65 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +68 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +139 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +38 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +39 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +25 -0
- package/deps/librdkafka/packaging/tools/requirements.txt +2 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +149 -0
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +172 -0
- package/deps/librdkafka/src/CMakeLists.txt +374 -0
- package/deps/librdkafka/src/Makefile +103 -0
- package/deps/librdkafka/src/README.lz4.md +30 -0
- package/deps/librdkafka/src/cJSON.c +2834 -0
- package/deps/librdkafka/src/cJSON.h +398 -0
- package/deps/librdkafka/src/crc32c.c +430 -0
- package/deps/librdkafka/src/crc32c.h +38 -0
- package/deps/librdkafka/src/generate_proto.sh +66 -0
- package/deps/librdkafka/src/librdkafka_cgrp_synch.png +0 -0
- package/deps/librdkafka/src/lz4.c +2727 -0
- package/deps/librdkafka/src/lz4.h +842 -0
- package/deps/librdkafka/src/lz4frame.c +2078 -0
- package/deps/librdkafka/src/lz4frame.h +692 -0
- package/deps/librdkafka/src/lz4frame_static.h +47 -0
- package/deps/librdkafka/src/lz4hc.c +1631 -0
- package/deps/librdkafka/src/lz4hc.h +413 -0
- package/deps/librdkafka/src/nanopb/pb.h +917 -0
- package/deps/librdkafka/src/nanopb/pb_common.c +388 -0
- package/deps/librdkafka/src/nanopb/pb_common.h +49 -0
- package/deps/librdkafka/src/nanopb/pb_decode.c +1727 -0
- package/deps/librdkafka/src/nanopb/pb_decode.h +193 -0
- package/deps/librdkafka/src/nanopb/pb_encode.c +1000 -0
- package/deps/librdkafka/src/nanopb/pb_encode.h +185 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.c +32 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.h +170 -0
- package/deps/librdkafka/src/opentelemetry/metrics.options +2 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.c +67 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.h +966 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.c +12 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.h +58 -0
- package/deps/librdkafka/src/queue.h +850 -0
- package/deps/librdkafka/src/rd.h +584 -0
- package/deps/librdkafka/src/rdaddr.c +255 -0
- package/deps/librdkafka/src/rdaddr.h +202 -0
- package/deps/librdkafka/src/rdatomic.h +230 -0
- package/deps/librdkafka/src/rdavg.h +260 -0
- package/deps/librdkafka/src/rdavl.c +210 -0
- package/deps/librdkafka/src/rdavl.h +250 -0
- package/deps/librdkafka/src/rdbase64.c +200 -0
- package/deps/librdkafka/src/rdbase64.h +43 -0
- package/deps/librdkafka/src/rdbuf.c +1884 -0
- package/deps/librdkafka/src/rdbuf.h +375 -0
- package/deps/librdkafka/src/rdcrc32.c +114 -0
- package/deps/librdkafka/src/rdcrc32.h +170 -0
- package/deps/librdkafka/src/rddl.c +179 -0
- package/deps/librdkafka/src/rddl.h +43 -0
- package/deps/librdkafka/src/rdendian.h +175 -0
- package/deps/librdkafka/src/rdfloat.h +67 -0
- package/deps/librdkafka/src/rdfnv1a.c +113 -0
- package/deps/librdkafka/src/rdfnv1a.h +35 -0
- package/deps/librdkafka/src/rdgz.c +120 -0
- package/deps/librdkafka/src/rdgz.h +46 -0
- package/deps/librdkafka/src/rdhdrhistogram.c +721 -0
- package/deps/librdkafka/src/rdhdrhistogram.h +87 -0
- package/deps/librdkafka/src/rdhttp.c +830 -0
- package/deps/librdkafka/src/rdhttp.h +101 -0
- package/deps/librdkafka/src/rdinterval.h +177 -0
- package/deps/librdkafka/src/rdkafka.c +5505 -0
- package/deps/librdkafka/src/rdkafka.h +10686 -0
- package/deps/librdkafka/src/rdkafka_admin.c +9794 -0
- package/deps/librdkafka/src/rdkafka_admin.h +661 -0
- package/deps/librdkafka/src/rdkafka_assignment.c +1010 -0
- package/deps/librdkafka/src/rdkafka_assignment.h +73 -0
- package/deps/librdkafka/src/rdkafka_assignor.c +1786 -0
- package/deps/librdkafka/src/rdkafka_assignor.h +402 -0
- package/deps/librdkafka/src/rdkafka_aux.c +409 -0
- package/deps/librdkafka/src/rdkafka_aux.h +174 -0
- package/deps/librdkafka/src/rdkafka_background.c +221 -0
- package/deps/librdkafka/src/rdkafka_broker.c +6337 -0
- package/deps/librdkafka/src/rdkafka_broker.h +744 -0
- package/deps/librdkafka/src/rdkafka_buf.c +543 -0
- package/deps/librdkafka/src/rdkafka_buf.h +1525 -0
- package/deps/librdkafka/src/rdkafka_cert.c +576 -0
- package/deps/librdkafka/src/rdkafka_cert.h +62 -0
- package/deps/librdkafka/src/rdkafka_cgrp.c +7587 -0
- package/deps/librdkafka/src/rdkafka_cgrp.h +477 -0
- package/deps/librdkafka/src/rdkafka_conf.c +4880 -0
- package/deps/librdkafka/src/rdkafka_conf.h +732 -0
- package/deps/librdkafka/src/rdkafka_confval.h +97 -0
- package/deps/librdkafka/src/rdkafka_coord.c +623 -0
- package/deps/librdkafka/src/rdkafka_coord.h +132 -0
- package/deps/librdkafka/src/rdkafka_error.c +228 -0
- package/deps/librdkafka/src/rdkafka_error.h +80 -0
- package/deps/librdkafka/src/rdkafka_event.c +502 -0
- package/deps/librdkafka/src/rdkafka_event.h +126 -0
- package/deps/librdkafka/src/rdkafka_feature.c +898 -0
- package/deps/librdkafka/src/rdkafka_feature.h +104 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +1422 -0
- package/deps/librdkafka/src/rdkafka_fetcher.h +44 -0
- package/deps/librdkafka/src/rdkafka_header.c +220 -0
- package/deps/librdkafka/src/rdkafka_header.h +76 -0
- package/deps/librdkafka/src/rdkafka_idempotence.c +807 -0
- package/deps/librdkafka/src/rdkafka_idempotence.h +144 -0
- package/deps/librdkafka/src/rdkafka_int.h +1260 -0
- package/deps/librdkafka/src/rdkafka_interceptor.c +819 -0
- package/deps/librdkafka/src/rdkafka_interceptor.h +104 -0
- package/deps/librdkafka/src/rdkafka_lz4.c +450 -0
- package/deps/librdkafka/src/rdkafka_lz4.h +49 -0
- package/deps/librdkafka/src/rdkafka_metadata.c +2209 -0
- package/deps/librdkafka/src/rdkafka_metadata.h +345 -0
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +1183 -0
- package/deps/librdkafka/src/rdkafka_mock.c +3661 -0
- package/deps/librdkafka/src/rdkafka_mock.h +610 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1876 -0
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +3113 -0
- package/deps/librdkafka/src/rdkafka_mock_int.h +710 -0
- package/deps/librdkafka/src/rdkafka_msg.c +2589 -0
- package/deps/librdkafka/src/rdkafka_msg.h +614 -0
- package/deps/librdkafka/src/rdkafka_msgbatch.h +62 -0
- package/deps/librdkafka/src/rdkafka_msgset.h +98 -0
- package/deps/librdkafka/src/rdkafka_msgset_reader.c +1806 -0
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +1474 -0
- package/deps/librdkafka/src/rdkafka_offset.c +1565 -0
- package/deps/librdkafka/src/rdkafka_offset.h +150 -0
- package/deps/librdkafka/src/rdkafka_op.c +997 -0
- package/deps/librdkafka/src/rdkafka_op.h +858 -0
- package/deps/librdkafka/src/rdkafka_partition.c +4896 -0
- package/deps/librdkafka/src/rdkafka_partition.h +1182 -0
- package/deps/librdkafka/src/rdkafka_pattern.c +228 -0
- package/deps/librdkafka/src/rdkafka_pattern.h +70 -0
- package/deps/librdkafka/src/rdkafka_plugin.c +213 -0
- package/deps/librdkafka/src/rdkafka_plugin.h +41 -0
- package/deps/librdkafka/src/rdkafka_proto.h +736 -0
- package/deps/librdkafka/src/rdkafka_protocol.h +128 -0
- package/deps/librdkafka/src/rdkafka_queue.c +1230 -0
- package/deps/librdkafka/src/rdkafka_queue.h +1220 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1748 -0
- package/deps/librdkafka/src/rdkafka_request.c +7089 -0
- package/deps/librdkafka/src/rdkafka_request.h +732 -0
- package/deps/librdkafka/src/rdkafka_roundrobin_assignor.c +123 -0
- package/deps/librdkafka/src/rdkafka_sasl.c +530 -0
- package/deps/librdkafka/src/rdkafka_sasl.h +63 -0
- package/deps/librdkafka/src/rdkafka_sasl_cyrus.c +722 -0
- package/deps/librdkafka/src/rdkafka_sasl_int.h +89 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +1833 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.h +52 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1666 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +47 -0
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +142 -0
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +858 -0
- package/deps/librdkafka/src/rdkafka_sasl_win32.c +550 -0
- package/deps/librdkafka/src/rdkafka_ssl.c +2129 -0
- package/deps/librdkafka/src/rdkafka_ssl.h +86 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4785 -0
- package/deps/librdkafka/src/rdkafka_subscription.c +278 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +760 -0
- package/deps/librdkafka/src/rdkafka_telemetry.h +52 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.c +1053 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.h +59 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +997 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +301 -0
- package/deps/librdkafka/src/rdkafka_timer.c +402 -0
- package/deps/librdkafka/src/rdkafka_timer.h +117 -0
- package/deps/librdkafka/src/rdkafka_topic.c +2161 -0
- package/deps/librdkafka/src/rdkafka_topic.h +334 -0
- package/deps/librdkafka/src/rdkafka_transport.c +1309 -0
- package/deps/librdkafka/src/rdkafka_transport.h +99 -0
- package/deps/librdkafka/src/rdkafka_transport_int.h +100 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +3256 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.h +171 -0
- package/deps/librdkafka/src/rdkafka_zstd.c +226 -0
- package/deps/librdkafka/src/rdkafka_zstd.h +57 -0
- package/deps/librdkafka/src/rdlist.c +576 -0
- package/deps/librdkafka/src/rdlist.h +434 -0
- package/deps/librdkafka/src/rdlog.c +89 -0
- package/deps/librdkafka/src/rdlog.h +41 -0
- package/deps/librdkafka/src/rdmap.c +508 -0
- package/deps/librdkafka/src/rdmap.h +492 -0
- package/deps/librdkafka/src/rdmurmur2.c +167 -0
- package/deps/librdkafka/src/rdmurmur2.h +35 -0
- package/deps/librdkafka/src/rdports.c +61 -0
- package/deps/librdkafka/src/rdports.h +38 -0
- package/deps/librdkafka/src/rdposix.h +250 -0
- package/deps/librdkafka/src/rdrand.c +80 -0
- package/deps/librdkafka/src/rdrand.h +43 -0
- package/deps/librdkafka/src/rdregex.c +156 -0
- package/deps/librdkafka/src/rdregex.h +43 -0
- package/deps/librdkafka/src/rdsignal.h +57 -0
- package/deps/librdkafka/src/rdstring.c +645 -0
- package/deps/librdkafka/src/rdstring.h +98 -0
- package/deps/librdkafka/src/rdsysqueue.h +404 -0
- package/deps/librdkafka/src/rdtime.h +356 -0
- package/deps/librdkafka/src/rdtypes.h +86 -0
- package/deps/librdkafka/src/rdunittest.c +549 -0
- package/deps/librdkafka/src/rdunittest.h +232 -0
- package/deps/librdkafka/src/rdvarint.c +134 -0
- package/deps/librdkafka/src/rdvarint.h +165 -0
- package/deps/librdkafka/src/rdwin32.h +382 -0
- package/deps/librdkafka/src/rdxxhash.c +1030 -0
- package/deps/librdkafka/src/rdxxhash.h +328 -0
- package/deps/librdkafka/src/regexp.c +1352 -0
- package/deps/librdkafka/src/regexp.h +41 -0
- package/deps/librdkafka/src/snappy.c +1866 -0
- package/deps/librdkafka/src/snappy.h +62 -0
- package/deps/librdkafka/src/snappy_compat.h +138 -0
- package/deps/librdkafka/src/statistics_schema.json +444 -0
- package/deps/librdkafka/src/tinycthread.c +932 -0
- package/deps/librdkafka/src/tinycthread.h +503 -0
- package/deps/librdkafka/src/tinycthread_extra.c +199 -0
- package/deps/librdkafka/src/tinycthread_extra.h +212 -0
- package/deps/librdkafka/src/win32_config.h +58 -0
- package/deps/librdkafka/src-cpp/CMakeLists.txt +90 -0
- package/deps/librdkafka/src-cpp/ConfImpl.cpp +84 -0
- package/deps/librdkafka/src-cpp/ConsumerImpl.cpp +244 -0
- package/deps/librdkafka/src-cpp/HandleImpl.cpp +436 -0
- package/deps/librdkafka/src-cpp/HeadersImpl.cpp +48 -0
- package/deps/librdkafka/src-cpp/KafkaConsumerImpl.cpp +296 -0
- package/deps/librdkafka/src-cpp/Makefile +55 -0
- package/deps/librdkafka/src-cpp/MessageImpl.cpp +38 -0
- package/deps/librdkafka/src-cpp/MetadataImpl.cpp +170 -0
- package/deps/librdkafka/src-cpp/ProducerImpl.cpp +197 -0
- package/deps/librdkafka/src-cpp/QueueImpl.cpp +70 -0
- package/deps/librdkafka/src-cpp/README.md +16 -0
- package/deps/librdkafka/src-cpp/RdKafka.cpp +59 -0
- package/deps/librdkafka/src-cpp/TopicImpl.cpp +124 -0
- package/deps/librdkafka/src-cpp/TopicPartitionImpl.cpp +57 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +3797 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp_int.h +1641 -0
- package/deps/librdkafka/tests/0000-unittests.c +72 -0
- package/deps/librdkafka/tests/0001-multiobj.c +102 -0
- package/deps/librdkafka/tests/0002-unkpart.c +244 -0
- package/deps/librdkafka/tests/0003-msgmaxsize.c +173 -0
- package/deps/librdkafka/tests/0004-conf.c +934 -0
- package/deps/librdkafka/tests/0005-order.c +133 -0
- package/deps/librdkafka/tests/0006-symbols.c +163 -0
- package/deps/librdkafka/tests/0007-autotopic.c +136 -0
- package/deps/librdkafka/tests/0008-reqacks.c +179 -0
- package/deps/librdkafka/tests/0009-mock_cluster.c +97 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +753 -0
- package/deps/librdkafka/tests/0012-produce_consume.c +537 -0
- package/deps/librdkafka/tests/0013-null-msgs.c +473 -0
- package/deps/librdkafka/tests/0014-reconsume-191.c +512 -0
- package/deps/librdkafka/tests/0015-offset_seeks.c +172 -0
- package/deps/librdkafka/tests/0016-client_swname.c +181 -0
- package/deps/librdkafka/tests/0017-compression.c +140 -0
- package/deps/librdkafka/tests/0018-cgrp_term.c +338 -0
- package/deps/librdkafka/tests/0019-list_groups.c +289 -0
- package/deps/librdkafka/tests/0020-destroy_hang.c +162 -0
- package/deps/librdkafka/tests/0021-rkt_destroy.c +72 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +279 -0
- package/deps/librdkafka/tests/0025-timers.c +147 -0
- package/deps/librdkafka/tests/0026-consume_pause.c +547 -0
- package/deps/librdkafka/tests/0028-long_topicnames.c +79 -0
- package/deps/librdkafka/tests/0029-assign_offset.c +202 -0
- package/deps/librdkafka/tests/0030-offset_commit.c +589 -0
- package/deps/librdkafka/tests/0031-get_offsets.c +235 -0
- package/deps/librdkafka/tests/0033-regex_subscribe.c +536 -0
- package/deps/librdkafka/tests/0034-offset_reset.c +398 -0
- package/deps/librdkafka/tests/0035-api_version.c +73 -0
- package/deps/librdkafka/tests/0036-partial_fetch.c +87 -0
- package/deps/librdkafka/tests/0037-destroy_hang_local.c +85 -0
- package/deps/librdkafka/tests/0038-performance.c +121 -0
- package/deps/librdkafka/tests/0039-event.c +284 -0
- package/deps/librdkafka/tests/0040-io_event.c +257 -0
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +97 -0
- package/deps/librdkafka/tests/0042-many_topics.c +252 -0
- package/deps/librdkafka/tests/0043-no_connection.c +77 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +94 -0
- package/deps/librdkafka/tests/0045-subscribe_update.c +1010 -0
- package/deps/librdkafka/tests/0046-rkt_cache.c +65 -0
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +98 -0
- package/deps/librdkafka/tests/0048-partitioner.c +283 -0
- package/deps/librdkafka/tests/0049-consume_conn_close.c +162 -0
- package/deps/librdkafka/tests/0050-subscribe_adds.c +145 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +126 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +238 -0
- package/deps/librdkafka/tests/0053-stats_cb.cpp +527 -0
- package/deps/librdkafka/tests/0054-offset_time.cpp +236 -0
- package/deps/librdkafka/tests/0055-producer_latency.c +539 -0
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +315 -0
- package/deps/librdkafka/tests/0057-invalid_topic.cpp +112 -0
- package/deps/librdkafka/tests/0058-log.cpp +123 -0
- package/deps/librdkafka/tests/0059-bsearch.cpp +241 -0
- package/deps/librdkafka/tests/0060-op_prio.cpp +163 -0
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +295 -0
- package/deps/librdkafka/tests/0062-stats_event.c +126 -0
- package/deps/librdkafka/tests/0063-clusterid.cpp +180 -0
- package/deps/librdkafka/tests/0064-interceptors.c +481 -0
- package/deps/librdkafka/tests/0065-yield.cpp +140 -0
- package/deps/librdkafka/tests/0066-plugins.cpp +129 -0
- package/deps/librdkafka/tests/0067-empty_topic.cpp +151 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +136 -0
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +119 -0
- package/deps/librdkafka/tests/0070-null_empty.cpp +197 -0
- package/deps/librdkafka/tests/0072-headers_ut.c +448 -0
- package/deps/librdkafka/tests/0073-headers.c +381 -0
- package/deps/librdkafka/tests/0074-producev.c +87 -0
- package/deps/librdkafka/tests/0075-retry.c +290 -0
- package/deps/librdkafka/tests/0076-produce_retry.c +452 -0
- package/deps/librdkafka/tests/0077-compaction.c +363 -0
- package/deps/librdkafka/tests/0078-c_from_cpp.cpp +96 -0
- package/deps/librdkafka/tests/0079-fork.c +93 -0
- package/deps/librdkafka/tests/0080-admin_ut.c +3095 -0
- package/deps/librdkafka/tests/0081-admin.c +5633 -0
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +137 -0
- package/deps/librdkafka/tests/0083-cb_event.c +233 -0
- package/deps/librdkafka/tests/0084-destroy_flags.c +208 -0
- package/deps/librdkafka/tests/0085-headers.cpp +392 -0
- package/deps/librdkafka/tests/0086-purge.c +368 -0
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +162 -0
- package/deps/librdkafka/tests/0089-max_poll_interval.c +511 -0
- package/deps/librdkafka/tests/0090-idempotence.c +171 -0
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +295 -0
- package/deps/librdkafka/tests/0092-mixed_msgver.c +103 -0
- package/deps/librdkafka/tests/0093-holb.c +200 -0
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +231 -0
- package/deps/librdkafka/tests/0095-all_brokers_down.cpp +122 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +658 -0
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +1218 -0
- package/deps/librdkafka/tests/0099-commit_metadata.c +194 -0
- package/deps/librdkafka/tests/0100-thread_interceptors.cpp +195 -0
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +446 -0
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +836 -0
- package/deps/librdkafka/tests/0103-transactions.c +1383 -0
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +625 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +3930 -0
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +318 -0
- package/deps/librdkafka/tests/0107-topic_recreate.c +259 -0
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +278 -0
- package/deps/librdkafka/tests/0110-batch_size.cpp +182 -0
- package/deps/librdkafka/tests/0111-delay_create_topics.cpp +127 -0
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +87 -0
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +3473 -0
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +176 -0
- package/deps/librdkafka/tests/0115-producer_auth.cpp +182 -0
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +216 -0
- package/deps/librdkafka/tests/0117-mock_errors.c +331 -0
- package/deps/librdkafka/tests/0118-commit_rebalance.c +154 -0
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +167 -0
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +185 -0
- package/deps/librdkafka/tests/0121-clusterid.c +115 -0
- package/deps/librdkafka/tests/0122-buffer_cleaning_after_rebalance.c +227 -0
- package/deps/librdkafka/tests/0123-connections_max_idle.c +98 -0
- package/deps/librdkafka/tests/0124-openssl_invalid_engine.c +69 -0
- package/deps/librdkafka/tests/0125-immediate_flush.c +144 -0
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +528 -0
- package/deps/librdkafka/tests/0127-fetch_queue_backoff.cpp +165 -0
- package/deps/librdkafka/tests/0128-sasl_callback_queue.cpp +125 -0
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +79 -0
- package/deps/librdkafka/tests/0130-store_offsets.c +178 -0
- package/deps/librdkafka/tests/0131-connect_timeout.c +81 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +179 -0
- package/deps/librdkafka/tests/0133-ssl_keys.c +150 -0
- package/deps/librdkafka/tests/0134-ssl_provider.c +92 -0
- package/deps/librdkafka/tests/0135-sasl_credentials.cpp +143 -0
- package/deps/librdkafka/tests/0136-resolve_cb.c +181 -0
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +619 -0
- package/deps/librdkafka/tests/0138-admin_mock.c +281 -0
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +950 -0
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +108 -0
- package/deps/librdkafka/tests/0142-reauthentication.c +515 -0
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +552 -0
- package/deps/librdkafka/tests/0144-idempotence_mock.c +373 -0
- package/deps/librdkafka/tests/0145-pause_resume_mock.c +119 -0
- package/deps/librdkafka/tests/0146-metadata_mock.c +505 -0
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +651 -0
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/1000-unktopic.c +164 -0
- package/deps/librdkafka/tests/8000-idle.cpp +60 -0
- package/deps/librdkafka/tests/8001-fetch_from_follower_mock_manual.c +113 -0
- package/deps/librdkafka/tests/CMakeLists.txt +170 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +291 -0
- package/deps/librdkafka/tests/Makefile +182 -0
- package/deps/librdkafka/tests/README.md +509 -0
- package/deps/librdkafka/tests/autotest.sh +33 -0
- package/deps/librdkafka/tests/backtrace.gdb +30 -0
- package/deps/librdkafka/tests/broker_version_tests.py +315 -0
- package/deps/librdkafka/tests/buildbox.sh +17 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +20 -0
- package/deps/librdkafka/tests/cluster_testing.py +191 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +56 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/Makefile +8 -0
- package/deps/librdkafka/tests/fixtures/ssl/README.md +13 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +50 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +168 -0
- package/deps/librdkafka/tests/fuzzers/Makefile +12 -0
- package/deps/librdkafka/tests/fuzzers/README.md +31 -0
- package/deps/librdkafka/tests/fuzzers/fuzz_regex.c +74 -0
- package/deps/librdkafka/tests/fuzzers/helpers.h +90 -0
- package/deps/librdkafka/tests/gen-ssl-certs.sh +165 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +170 -0
- package/deps/librdkafka/tests/interceptor_test/CMakeLists.txt +16 -0
- package/deps/librdkafka/tests/interceptor_test/Makefile +22 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.c +314 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.h +54 -0
- package/deps/librdkafka/tests/java/IncrementalRebalanceCli.java +97 -0
- package/deps/librdkafka/tests/java/Makefile +13 -0
- package/deps/librdkafka/tests/java/Murmur2Cli.java +46 -0
- package/deps/librdkafka/tests/java/README.md +14 -0
- package/deps/librdkafka/tests/java/TransactionProducerCli.java +162 -0
- package/deps/librdkafka/tests/java/run-class.sh +11 -0
- package/deps/librdkafka/tests/librdkafka.suppressions +483 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +59 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +50 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +43 -0
- package/deps/librdkafka/tests/performance_plot.py +115 -0
- package/deps/librdkafka/tests/plugin_test/Makefile +19 -0
- package/deps/librdkafka/tests/plugin_test/plugin_test.c +58 -0
- package/deps/librdkafka/tests/requirements.txt +2 -0
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +140 -0
- package/deps/librdkafka/tests/rusage.c +249 -0
- package/deps/librdkafka/tests/sasl_test.py +289 -0
- package/deps/librdkafka/tests/scenarios/README.md +6 -0
- package/deps/librdkafka/tests/scenarios/ak23.json +6 -0
- package/deps/librdkafka/tests/scenarios/default.json +5 -0
- package/deps/librdkafka/tests/scenarios/noautocreate.json +5 -0
- package/deps/librdkafka/tests/sockem.c +801 -0
- package/deps/librdkafka/tests/sockem.h +85 -0
- package/deps/librdkafka/tests/sockem_ctrl.c +145 -0
- package/deps/librdkafka/tests/sockem_ctrl.h +61 -0
- package/deps/librdkafka/tests/test.c +7778 -0
- package/deps/librdkafka/tests/test.conf.example +27 -0
- package/deps/librdkafka/tests/test.h +1028 -0
- package/deps/librdkafka/tests/testcpp.cpp +131 -0
- package/deps/librdkafka/tests/testcpp.h +388 -0
- package/deps/librdkafka/tests/testshared.h +416 -0
- package/deps/librdkafka/tests/tools/README.md +4 -0
- package/deps/librdkafka/tests/tools/stats/README.md +21 -0
- package/deps/librdkafka/tests/tools/stats/filter.jq +42 -0
- package/deps/librdkafka/tests/tools/stats/graph.py +150 -0
- package/deps/librdkafka/tests/tools/stats/requirements.txt +3 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +124 -0
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +87 -0
- package/deps/librdkafka/tests/xxxx-assign_partition.c +122 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +159 -0
- package/deps/librdkafka/vcpkg.json +23 -0
- package/deps/librdkafka/win32/README.md +5 -0
- package/deps/librdkafka/win32/build-package.bat +3 -0
- package/deps/librdkafka/win32/build.bat +19 -0
- package/deps/librdkafka/win32/common.vcxproj +84 -0
- package/deps/librdkafka/win32/interceptor_test/interceptor_test.vcxproj +87 -0
- package/deps/librdkafka/win32/librdkafka.autopkg.template +54 -0
- package/deps/librdkafka/win32/librdkafka.master.testing.targets +13 -0
- package/deps/librdkafka/win32/librdkafka.sln +226 -0
- package/deps/librdkafka/win32/librdkafka.vcxproj +276 -0
- package/deps/librdkafka/win32/librdkafkacpp/librdkafkacpp.vcxproj +104 -0
- package/deps/librdkafka/win32/msbuild.ps1 +15 -0
- package/deps/librdkafka/win32/openssl_engine_example/openssl_engine_example.vcxproj +132 -0
- package/deps/librdkafka/win32/package-zip.ps1 +46 -0
- package/deps/librdkafka/win32/packages/repositories.config +4 -0
- package/deps/librdkafka/win32/push-package.bat +4 -0
- package/deps/librdkafka/win32/rdkafka_complex_consumer_example_cpp/rdkafka_complex_consumer_example_cpp.vcxproj +67 -0
- package/deps/librdkafka/win32/rdkafka_example/rdkafka_example.vcxproj +97 -0
- package/deps/librdkafka/win32/rdkafka_performance/rdkafka_performance.vcxproj +97 -0
- package/deps/librdkafka/win32/setup-msys2.ps1 +47 -0
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +34 -0
- package/deps/librdkafka/win32/tests/test.conf.example +25 -0
- package/deps/librdkafka/win32/tests/tests.vcxproj +253 -0
- package/deps/librdkafka/win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj +132 -0
- package/deps/librdkafka/win32/wingetopt.c +564 -0
- package/deps/librdkafka/win32/wingetopt.h +101 -0
- package/deps/librdkafka/win32/wintime.h +33 -0
- package/deps/librdkafka.gyp +62 -0
- package/lib/admin.js +233 -0
- package/lib/client.js +573 -0
- package/lib/error.js +500 -0
- package/lib/index.js +34 -0
- package/lib/kafka-consumer-stream.js +397 -0
- package/lib/kafka-consumer.js +698 -0
- package/lib/producer/high-level-producer.js +323 -0
- package/lib/producer-stream.js +307 -0
- package/lib/producer.js +375 -0
- package/lib/tools/ref-counter.js +52 -0
- package/lib/topic-partition.js +88 -0
- package/lib/topic.js +42 -0
- package/lib/util.js +29 -0
- package/package.json +61 -0
- package/prebuilds/darwin-arm64/@point3+node-rdkafka.node +0 -0
- package/prebuilds/linux-x64/@point3+node-rdkafka.node +0 -0
- package/util/configure.js +30 -0
- package/util/get-env.js +6 -0
- package/util/test-compile.js +11 -0
- package/util/test-producer-delivery.js +100 -0
|
@@ -0,0 +1,1182 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* librdkafka - The Apache Kafka C/C++ library
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2015-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 _RDKAFKA_PARTITION_H_
|
|
30
|
+
#define _RDKAFKA_PARTITION_H_
|
|
31
|
+
|
|
32
|
+
#include "rdkafka_topic.h"
|
|
33
|
+
#include "rdkafka_cgrp.h"
|
|
34
|
+
#include "rdkafka_broker.h"
|
|
35
|
+
|
|
36
|
+
extern const char *rd_kafka_fetch_states[];
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @brief Offset statistics
|
|
41
|
+
*/
|
|
42
|
+
struct offset_stats {
|
|
43
|
+
rd_kafka_fetch_pos_t fetch_pos; /**< Next offset to fetch */
|
|
44
|
+
int64_t eof_offset; /**< Last offset we reported EOF for */
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief Reset offset_stats struct to default values
|
|
49
|
+
*/
|
|
50
|
+
static RD_UNUSED void rd_kafka_offset_stats_reset(struct offset_stats *offs) {
|
|
51
|
+
offs->fetch_pos.offset = 0;
|
|
52
|
+
offs->fetch_pos.leader_epoch = -1;
|
|
53
|
+
offs->eof_offset = RD_KAFKA_OFFSET_INVALID;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @brief Store information about a partition error for future use.
|
|
59
|
+
*/
|
|
60
|
+
struct rd_kafka_toppar_err {
|
|
61
|
+
rd_kafka_resp_err_t err; /**< Error code */
|
|
62
|
+
int actions; /**< Request actions */
|
|
63
|
+
rd_ts_t ts; /**< Timestamp */
|
|
64
|
+
uint64_t base_msgid; /**< First msg msgid */
|
|
65
|
+
int32_t base_seq; /**< Idempodent Producer:
|
|
66
|
+
* first msg sequence */
|
|
67
|
+
int32_t last_seq; /**< Idempotent Producer:
|
|
68
|
+
* last msg sequence */
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @brief Fetchpos comparator, only offset is compared.
|
|
73
|
+
*/
|
|
74
|
+
static RD_UNUSED RD_INLINE int
|
|
75
|
+
rd_kafka_fetch_pos_cmp_offset(const rd_kafka_fetch_pos_t *a,
|
|
76
|
+
const rd_kafka_fetch_pos_t *b) {
|
|
77
|
+
return (RD_CMP(a->offset, b->offset));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @brief Fetchpos comparator, leader epoch has precedence
|
|
82
|
+
* iff both values are not null.
|
|
83
|
+
*/
|
|
84
|
+
static RD_UNUSED RD_INLINE int
|
|
85
|
+
rd_kafka_fetch_pos_cmp(const rd_kafka_fetch_pos_t *a,
|
|
86
|
+
const rd_kafka_fetch_pos_t *b) {
|
|
87
|
+
if (a->leader_epoch == -1 || b->leader_epoch == -1)
|
|
88
|
+
return rd_kafka_fetch_pos_cmp_offset(a, b);
|
|
89
|
+
if (a->leader_epoch < b->leader_epoch)
|
|
90
|
+
return -1;
|
|
91
|
+
else if (a->leader_epoch > b->leader_epoch)
|
|
92
|
+
return 1;
|
|
93
|
+
else
|
|
94
|
+
return rd_kafka_fetch_pos_cmp_offset(a, b);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
static RD_UNUSED RD_INLINE void
|
|
99
|
+
rd_kafka_fetch_pos_init(rd_kafka_fetch_pos_t *fetchpos) {
|
|
100
|
+
fetchpos->offset = RD_KAFKA_OFFSET_INVALID;
|
|
101
|
+
fetchpos->leader_epoch = -1;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const char *rd_kafka_fetch_pos2str(const rd_kafka_fetch_pos_t fetchpos);
|
|
105
|
+
|
|
106
|
+
static RD_UNUSED RD_INLINE rd_kafka_fetch_pos_t
|
|
107
|
+
rd_kafka_fetch_pos_make(int64_t offset,
|
|
108
|
+
int32_t leader_epoch,
|
|
109
|
+
rd_bool_t validated) {
|
|
110
|
+
rd_kafka_fetch_pos_t fetchpos = {offset, leader_epoch, validated};
|
|
111
|
+
return fetchpos;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
#ifdef RD_HAS_STATEMENT_EXPRESSIONS
|
|
115
|
+
#define RD_KAFKA_FETCH_POS0(offset, leader_epoch, validated) \
|
|
116
|
+
({ \
|
|
117
|
+
rd_kafka_fetch_pos_t _fetchpos = {offset, leader_epoch, \
|
|
118
|
+
validated}; \
|
|
119
|
+
_fetchpos; \
|
|
120
|
+
})
|
|
121
|
+
#else
|
|
122
|
+
#define RD_KAFKA_FETCH_POS0(offset, leader_epoch, validated) \
|
|
123
|
+
rd_kafka_fetch_pos_make(offset, leader_epoch, validated)
|
|
124
|
+
#endif
|
|
125
|
+
|
|
126
|
+
#define RD_KAFKA_FETCH_POS(offset, leader_epoch) \
|
|
127
|
+
RD_KAFKA_FETCH_POS0(offset, leader_epoch, rd_false)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
typedef TAILQ_HEAD(rd_kafka_toppar_tqhead_s,
|
|
132
|
+
rd_kafka_toppar_s) rd_kafka_toppar_tqhead_t;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Topic + Partition combination
|
|
136
|
+
*/
|
|
137
|
+
struct rd_kafka_toppar_s { /* rd_kafka_toppar_t */
|
|
138
|
+
TAILQ_ENTRY(rd_kafka_toppar_s) rktp_rklink; /* rd_kafka_t link */
|
|
139
|
+
TAILQ_ENTRY(rd_kafka_toppar_s) rktp_rkblink; /* rd_kafka_broker_t link*/
|
|
140
|
+
CIRCLEQ_ENTRY(rd_kafka_toppar_s)
|
|
141
|
+
rktp_activelink; /* rkb_active_toppars */
|
|
142
|
+
TAILQ_ENTRY(rd_kafka_toppar_s) rktp_rktlink; /* rd_kafka_topic_t link*/
|
|
143
|
+
TAILQ_ENTRY(rd_kafka_toppar_s) rktp_cgrplink; /* rd_kafka_cgrp_t link */
|
|
144
|
+
TAILQ_ENTRY(rd_kafka_toppar_s)
|
|
145
|
+
rktp_txnlink; /**< rd_kafka_t.rk_eos.
|
|
146
|
+
* txn_pend_rktps
|
|
147
|
+
* or txn_rktps */
|
|
148
|
+
rd_kafka_topic_t *rktp_rkt; /**< This toppar's topic object */
|
|
149
|
+
int32_t rktp_partition;
|
|
150
|
+
// LOCK: toppar_lock() + topic_wrlock()
|
|
151
|
+
// LOCK: .. in partition_available()
|
|
152
|
+
int32_t rktp_leader_id; /**< Current leader id.
|
|
153
|
+
* This is updated directly
|
|
154
|
+
* from metadata. */
|
|
155
|
+
int32_t rktp_broker_id; /**< Current broker id. */
|
|
156
|
+
rd_kafka_broker_t *rktp_leader; /**< Current leader broker.
|
|
157
|
+
* This updated simultaneously
|
|
158
|
+
* with rktp_leader_id. */
|
|
159
|
+
rd_kafka_broker_t *rktp_broker; /**< Current preferred broker
|
|
160
|
+
* (usually the leader).
|
|
161
|
+
* This updated asynchronously
|
|
162
|
+
* by issuing JOIN op to
|
|
163
|
+
* broker thread, so be careful
|
|
164
|
+
* in using this since it
|
|
165
|
+
* may lag. */
|
|
166
|
+
rd_kafka_broker_t *rktp_next_broker; /**< Next preferred broker after
|
|
167
|
+
* async migration op. */
|
|
168
|
+
rd_refcnt_t rktp_refcnt;
|
|
169
|
+
mtx_t rktp_lock;
|
|
170
|
+
|
|
171
|
+
// LOCK: toppar_lock. toppar_insert_msg(), concat_msgq()
|
|
172
|
+
// LOCK: toppar_lock. toppar_enq_msg(), deq_msg(), toppar_retry_msgq()
|
|
173
|
+
rd_kafka_q_t *rktp_msgq_wakeup_q; /**< Wake-up queue */
|
|
174
|
+
rd_kafka_msgq_t rktp_msgq; /* application->rdkafka queue.
|
|
175
|
+
* protected by rktp_lock */
|
|
176
|
+
rd_kafka_msgq_t rktp_xmit_msgq; /* internal broker xmit queue.
|
|
177
|
+
* local to broker thread. */
|
|
178
|
+
|
|
179
|
+
int rktp_fetch; /* On rkb_active_toppars list */
|
|
180
|
+
|
|
181
|
+
/* Consumer */
|
|
182
|
+
rd_kafka_q_t *rktp_fetchq; /* Queue of fetched messages
|
|
183
|
+
* from broker.
|
|
184
|
+
* Broker thread -> App */
|
|
185
|
+
rd_kafka_q_t *rktp_ops; /* * -> Main thread */
|
|
186
|
+
|
|
187
|
+
rd_atomic32_t rktp_msgs_inflight; /**< Current number of
|
|
188
|
+
* messages in-flight to/from
|
|
189
|
+
* the broker. */
|
|
190
|
+
|
|
191
|
+
uint64_t rktp_msgid; /**< Current/last message id.
|
|
192
|
+
* Each message enqueued on a
|
|
193
|
+
* non-UA partition will get a
|
|
194
|
+
* partition-unique sequencial
|
|
195
|
+
* number assigned.
|
|
196
|
+
* This number is used to
|
|
197
|
+
* re-enqueue the message
|
|
198
|
+
* on resends but making sure
|
|
199
|
+
* the input ordering is still
|
|
200
|
+
* maintained, and used by
|
|
201
|
+
* the idempotent producer.
|
|
202
|
+
* Starts at 1.
|
|
203
|
+
* Protected by toppar_lock */
|
|
204
|
+
struct {
|
|
205
|
+
rd_kafka_pid_t pid; /**< Partition's last known
|
|
206
|
+
* Producer Id and epoch.
|
|
207
|
+
* Protected by toppar lock.
|
|
208
|
+
* Only updated in toppar
|
|
209
|
+
* handler thread. */
|
|
210
|
+
uint64_t acked_msgid; /**< Highest acknowledged message.
|
|
211
|
+
* Protected by toppar lock. */
|
|
212
|
+
uint64_t epoch_base_msgid; /**< This Producer epoch's
|
|
213
|
+
* base msgid.
|
|
214
|
+
* When a new epoch is
|
|
215
|
+
* acquired, or on transaction
|
|
216
|
+
* abort, the base_seq is set to
|
|
217
|
+
* the current rktp_msgid so that
|
|
218
|
+
* sub-sequent produce
|
|
219
|
+
* requests will have
|
|
220
|
+
* a sequence number series
|
|
221
|
+
* starting at 0.
|
|
222
|
+
* Protected by toppar_lock */
|
|
223
|
+
int32_t next_ack_seq; /**< Next expected ack sequence.
|
|
224
|
+
* Protected by toppar lock. */
|
|
225
|
+
int32_t next_err_seq; /**< Next expected error sequence.
|
|
226
|
+
* Used when draining outstanding
|
|
227
|
+
* issues.
|
|
228
|
+
* This value will be the same
|
|
229
|
+
* as next_ack_seq until a
|
|
230
|
+
* drainable error occurs,
|
|
231
|
+
* in which case it
|
|
232
|
+
* will advance past next_ack_seq.
|
|
233
|
+
* next_ack_seq can never be larger
|
|
234
|
+
* than next_err_seq.
|
|
235
|
+
* Protected by toppar lock. */
|
|
236
|
+
rd_bool_t wait_drain; /**< All inflight requests must
|
|
237
|
+
* be drained/finish before
|
|
238
|
+
* resuming producing.
|
|
239
|
+
* This is set to true
|
|
240
|
+
* when a leader change
|
|
241
|
+
* happens so that the
|
|
242
|
+
* in-flight messages for the
|
|
243
|
+
* old brokers finish before
|
|
244
|
+
* the new broker starts sending.
|
|
245
|
+
* This as a step to ensure
|
|
246
|
+
* consistency.
|
|
247
|
+
* Only accessed from toppar
|
|
248
|
+
* handler thread. */
|
|
249
|
+
} rktp_eos;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* rktp version barriers
|
|
253
|
+
*
|
|
254
|
+
* rktp_version is the application/controller side's
|
|
255
|
+
* authoritative version, it depicts the most up to date state.
|
|
256
|
+
* This is what q_filter() matches an rko_version to.
|
|
257
|
+
*
|
|
258
|
+
* rktp_op_version is the last/current received state handled
|
|
259
|
+
* by the toppar in the broker thread. It is updated to rktp_version
|
|
260
|
+
* when receiving a new op.
|
|
261
|
+
*
|
|
262
|
+
* rktp_fetch_version is the current fetcher decision version.
|
|
263
|
+
* It is used in fetch_decide() to see if the fetch decision
|
|
264
|
+
* needs to be updated by comparing to rktp_op_version.
|
|
265
|
+
*
|
|
266
|
+
* Example:
|
|
267
|
+
* App thread : Send OP_START (v1 bump): rktp_version=1
|
|
268
|
+
* Broker thread: Recv OP_START (v1): rktp_op_version=1
|
|
269
|
+
* Broker thread: fetch_decide() detects that
|
|
270
|
+
* rktp_op_version != rktp_fetch_version and
|
|
271
|
+
* sets rktp_fetch_version=1.
|
|
272
|
+
* Broker thread: next Fetch request has it's tver state set to
|
|
273
|
+
* rktp_fetch_verison (v1).
|
|
274
|
+
*
|
|
275
|
+
* App thread : Send OP_SEEK (v2 bump): rktp_version=2
|
|
276
|
+
* Broker thread: Recv OP_SEEK (v2): rktp_op_version=2
|
|
277
|
+
* Broker thread: Recv IO FetchResponse with tver=1,
|
|
278
|
+
* when enqueued on rktp_fetchq they're discarded
|
|
279
|
+
* due to old version (tver<rktp_version).
|
|
280
|
+
* Broker thread: fetch_decide() detects version change and
|
|
281
|
+
* sets rktp_fetch_version=2.
|
|
282
|
+
* Broker thread: next Fetch request has tver=2
|
|
283
|
+
* Broker thread: Recv IO FetchResponse with tver=2 which
|
|
284
|
+
* is same as rktp_version so message is forwarded
|
|
285
|
+
* to app.
|
|
286
|
+
*/
|
|
287
|
+
rd_atomic32_t rktp_version; /* Latest op version.
|
|
288
|
+
* Authoritative (app thread)*/
|
|
289
|
+
int32_t rktp_op_version; /* Op version of curr command
|
|
290
|
+
* state from.
|
|
291
|
+
* (broker thread) */
|
|
292
|
+
int32_t rktp_fetch_version; /* Op version of curr fetch.
|
|
293
|
+
(broker thread) */
|
|
294
|
+
|
|
295
|
+
enum {
|
|
296
|
+
RD_KAFKA_TOPPAR_FETCH_NONE = 0,
|
|
297
|
+
RD_KAFKA_TOPPAR_FETCH_STOPPING,
|
|
298
|
+
RD_KAFKA_TOPPAR_FETCH_STOPPED,
|
|
299
|
+
RD_KAFKA_TOPPAR_FETCH_OFFSET_QUERY,
|
|
300
|
+
RD_KAFKA_TOPPAR_FETCH_OFFSET_WAIT,
|
|
301
|
+
RD_KAFKA_TOPPAR_FETCH_VALIDATE_EPOCH_WAIT,
|
|
302
|
+
RD_KAFKA_TOPPAR_FETCH_ACTIVE,
|
|
303
|
+
} rktp_fetch_state; /* Broker thread's state */
|
|
304
|
+
|
|
305
|
+
#define RD_KAFKA_TOPPAR_FETCH_IS_STARTED(fetch_state) \
|
|
306
|
+
((fetch_state) >= RD_KAFKA_TOPPAR_FETCH_OFFSET_QUERY)
|
|
307
|
+
|
|
308
|
+
int32_t rktp_leader_epoch; /**< Last known partition leader epoch,
|
|
309
|
+
* or -1. */
|
|
310
|
+
|
|
311
|
+
int32_t rktp_fetch_msg_max_bytes; /* Max number of bytes to
|
|
312
|
+
* fetch.
|
|
313
|
+
* Locality: broker thread
|
|
314
|
+
*/
|
|
315
|
+
|
|
316
|
+
rd_ts_t rktp_ts_fetch_backoff; /* Back off fetcher for
|
|
317
|
+
* this partition until this
|
|
318
|
+
* absolute timestamp
|
|
319
|
+
* expires. */
|
|
320
|
+
|
|
321
|
+
/** Offset to query broker for. */
|
|
322
|
+
rd_kafka_fetch_pos_t rktp_query_pos;
|
|
323
|
+
|
|
324
|
+
/** Next fetch start position.
|
|
325
|
+
* This is set up start, seek, resume, etc, to tell
|
|
326
|
+
* the fetcher where to start fetching.
|
|
327
|
+
* It is not updated for each fetch, see
|
|
328
|
+
* rktp_offsets.fetch_pos for that.
|
|
329
|
+
* @locality toppar thread */
|
|
330
|
+
rd_kafka_fetch_pos_t rktp_next_fetch_start;
|
|
331
|
+
|
|
332
|
+
/** The previous next fetch position.
|
|
333
|
+
* @locality toppar thread */
|
|
334
|
+
rd_kafka_fetch_pos_t rktp_last_next_fetch_start;
|
|
335
|
+
|
|
336
|
+
/** The offset to verify.
|
|
337
|
+
* @locality toppar thread */
|
|
338
|
+
rd_kafka_fetch_pos_t rktp_offset_validation_pos;
|
|
339
|
+
|
|
340
|
+
/** Application's position.
|
|
341
|
+
* This is the latest offset delivered to application + 1.
|
|
342
|
+
* It is reset to INVALID_OFFSET when partition is
|
|
343
|
+
* unassigned/stopped/seeked. */
|
|
344
|
+
rd_kafka_fetch_pos_t rktp_app_pos;
|
|
345
|
+
|
|
346
|
+
/** Last stored offset, but maybe not yet committed. */
|
|
347
|
+
rd_kafka_fetch_pos_t rktp_stored_pos;
|
|
348
|
+
|
|
349
|
+
/* Last stored metadata, but
|
|
350
|
+
* maybe not committed yet. */
|
|
351
|
+
void *rktp_stored_metadata;
|
|
352
|
+
size_t rktp_stored_metadata_size;
|
|
353
|
+
|
|
354
|
+
/** Offset currently being committed */
|
|
355
|
+
rd_kafka_fetch_pos_t rktp_committing_pos;
|
|
356
|
+
|
|
357
|
+
/** Last (known) committed offset */
|
|
358
|
+
rd_kafka_fetch_pos_t rktp_committed_pos;
|
|
359
|
+
|
|
360
|
+
rd_ts_t rktp_ts_committed_offset; /**< Timestamp of last commit */
|
|
361
|
+
|
|
362
|
+
struct offset_stats rktp_offsets; /* Current offsets.
|
|
363
|
+
* Locality: broker thread*/
|
|
364
|
+
struct offset_stats rktp_offsets_fin; /* Finalized offset for stats.
|
|
365
|
+
* Updated periodically
|
|
366
|
+
* by broker thread.
|
|
367
|
+
* Locks: toppar_lock */
|
|
368
|
+
|
|
369
|
+
int64_t rktp_ls_offset; /**< Current last stable offset
|
|
370
|
+
* Locks: toppar_lock */
|
|
371
|
+
int64_t rktp_hi_offset; /* Current high watermark offset.
|
|
372
|
+
* Locks: toppar_lock */
|
|
373
|
+
int64_t rktp_lo_offset; /* Current broker low offset.
|
|
374
|
+
* This is outside of the stats
|
|
375
|
+
* struct due to this field
|
|
376
|
+
* being populated by the
|
|
377
|
+
* toppar thread rather than
|
|
378
|
+
* the broker thread.
|
|
379
|
+
* Locality: toppar thread
|
|
380
|
+
* Locks: toppar_lock */
|
|
381
|
+
|
|
382
|
+
rd_ts_t rktp_ts_offset_lag;
|
|
383
|
+
|
|
384
|
+
char *rktp_offset_path; /* Path to offset file */
|
|
385
|
+
FILE *rktp_offset_fp; /* Offset file pointer */
|
|
386
|
+
|
|
387
|
+
rd_kafka_resp_err_t rktp_last_error; /**< Last Fetch error.
|
|
388
|
+
* Used for suppressing
|
|
389
|
+
* reoccuring errors.
|
|
390
|
+
* @locality broker thread */
|
|
391
|
+
|
|
392
|
+
rd_kafka_cgrp_t *rktp_cgrp; /* Belongs to this cgrp */
|
|
393
|
+
|
|
394
|
+
rd_bool_t rktp_started; /**< Fetcher is instructured to
|
|
395
|
+
* start.
|
|
396
|
+
* This is used by cgrp to keep
|
|
397
|
+
* track of whether the toppar has
|
|
398
|
+
* been started or not. */
|
|
399
|
+
|
|
400
|
+
rd_kafka_replyq_t rktp_replyq; /* Current replyq+version
|
|
401
|
+
* for propagating
|
|
402
|
+
* major operations, e.g.,
|
|
403
|
+
* FETCH_STOP. */
|
|
404
|
+
// LOCK: toppar_lock(). RD_KAFKA_TOPPAR_F_DESIRED
|
|
405
|
+
// LOCK: toppar_lock(). RD_KAFKA_TOPPAR_F_UNKNOWN
|
|
406
|
+
int rktp_flags;
|
|
407
|
+
#define RD_KAFKA_TOPPAR_F_DESIRED \
|
|
408
|
+
0x1 /* This partition is desired \
|
|
409
|
+
* by a consumer. */
|
|
410
|
+
#define RD_KAFKA_TOPPAR_F_UNKNOWN \
|
|
411
|
+
0x2 /* Topic is not yet or no longer \
|
|
412
|
+
* seen on a broker. */
|
|
413
|
+
#define RD_KAFKA_TOPPAR_F_OFFSET_STORE 0x4 /* Offset store is active */
|
|
414
|
+
#define RD_KAFKA_TOPPAR_F_OFFSET_STORE_STOPPING \
|
|
415
|
+
0x8 /* Offset store stopping \
|
|
416
|
+
*/
|
|
417
|
+
#define RD_KAFKA_TOPPAR_F_APP_PAUSE 0x10 /* App pause()d consumption */
|
|
418
|
+
#define RD_KAFKA_TOPPAR_F_LIB_PAUSE 0x20 /* librdkafka paused consumption */
|
|
419
|
+
#define RD_KAFKA_TOPPAR_F_REMOVE 0x40 /* partition removed from cluster */
|
|
420
|
+
#define RD_KAFKA_TOPPAR_F_LEADER_ERR \
|
|
421
|
+
0x80 /* Operation failed: \
|
|
422
|
+
* leader might be missing. \
|
|
423
|
+
* Typically set from \
|
|
424
|
+
* ProduceResponse failure. */
|
|
425
|
+
#define RD_KAFKA_TOPPAR_F_PEND_TXN \
|
|
426
|
+
0x100 /* Partition is pending being added \
|
|
427
|
+
* to a producer transaction. */
|
|
428
|
+
#define RD_KAFKA_TOPPAR_F_IN_TXN \
|
|
429
|
+
0x200 /* Partition is part of \
|
|
430
|
+
* a producer transaction. */
|
|
431
|
+
#define RD_KAFKA_TOPPAR_F_ON_DESP 0x400 /**< On rkt_desp list */
|
|
432
|
+
#define RD_KAFKA_TOPPAR_F_ON_CGRP 0x800 /**< On rkcg_toppars list */
|
|
433
|
+
#define RD_KAFKA_TOPPAR_F_ON_RKB 0x1000 /**< On rkb_toppars list */
|
|
434
|
+
#define RD_KAFKA_TOPPAR_F_ASSIGNED \
|
|
435
|
+
0x2000 /**< Toppar is part of the consumer \
|
|
436
|
+
* assignment. */
|
|
437
|
+
#define RD_KAFKA_TOPPAR_F_VALIDATING \
|
|
438
|
+
0x4000 /**< Toppar is currently requesting validation. */
|
|
439
|
+
|
|
440
|
+
/*
|
|
441
|
+
* Timers
|
|
442
|
+
*/
|
|
443
|
+
rd_kafka_timer_t rktp_offset_query_tmr; /* Offset query timer */
|
|
444
|
+
rd_kafka_timer_t rktp_offset_commit_tmr; /* Offset commit timer */
|
|
445
|
+
rd_kafka_timer_t rktp_offset_sync_tmr; /* Offset file sync timer */
|
|
446
|
+
rd_kafka_timer_t rktp_consumer_lag_tmr; /* Consumer lag monitoring
|
|
447
|
+
* timer */
|
|
448
|
+
rd_kafka_timer_t rktp_validate_tmr; /**< Offset and epoch
|
|
449
|
+
* validation retry timer */
|
|
450
|
+
|
|
451
|
+
rd_interval_t rktp_lease_intvl; /**< Preferred replica lease
|
|
452
|
+
* period */
|
|
453
|
+
rd_interval_t rktp_new_lease_intvl; /**< Controls max frequency
|
|
454
|
+
* at which a new preferred
|
|
455
|
+
* replica lease can be
|
|
456
|
+
* created for a toppar.
|
|
457
|
+
*/
|
|
458
|
+
rd_interval_t rktp_new_lease_log_intvl; /**< .. and how often
|
|
459
|
+
* we log about it. */
|
|
460
|
+
rd_interval_t rktp_metadata_intvl; /**< Controls max frequency
|
|
461
|
+
* of metadata requests
|
|
462
|
+
* in preferred replica
|
|
463
|
+
* handler.
|
|
464
|
+
*/
|
|
465
|
+
|
|
466
|
+
int rktp_wait_consumer_lag_resp; /* Waiting for consumer lag
|
|
467
|
+
* response. */
|
|
468
|
+
|
|
469
|
+
struct rd_kafka_toppar_err rktp_last_err; /**< Last produce error */
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
struct {
|
|
473
|
+
rd_atomic64_t tx_msgs; /**< Producer: sent messages */
|
|
474
|
+
rd_atomic64_t tx_msg_bytes; /**< .. bytes */
|
|
475
|
+
rd_atomic64_t rx_msgs; /**< Consumer: received messages */
|
|
476
|
+
rd_atomic64_t rx_msg_bytes; /**< .. bytes */
|
|
477
|
+
rd_atomic64_t producer_enq_msgs; /**< Producer: enqueued msgs */
|
|
478
|
+
rd_atomic64_t rx_ver_drops; /**< Consumer: outdated message
|
|
479
|
+
* drops. */
|
|
480
|
+
} rktp_c;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* @struct This is a separately allocated glue object used in
|
|
485
|
+
* rd_kafka_topic_partition_t._private to allow referencing both
|
|
486
|
+
* an rktp and/or a leader epoch. Both are optional.
|
|
487
|
+
* The rktp, if non-NULL, owns a refcount.
|
|
488
|
+
*
|
|
489
|
+
* This glue object is not always set in ._private, but allocated on demand
|
|
490
|
+
* as necessary.
|
|
491
|
+
*/
|
|
492
|
+
typedef struct rd_kafka_topic_partition_private_s {
|
|
493
|
+
/** Reference to a toppar. Optional, may be NULL. */
|
|
494
|
+
rd_kafka_toppar_t *rktp;
|
|
495
|
+
/** Current Leader epoch, if known, else -1.
|
|
496
|
+
* this is set when the API needs to send the last epoch known
|
|
497
|
+
* by the client. */
|
|
498
|
+
int32_t current_leader_epoch;
|
|
499
|
+
/** Leader epoch if known, else -1. */
|
|
500
|
+
int32_t leader_epoch;
|
|
501
|
+
/** Topic id. */
|
|
502
|
+
rd_kafka_Uuid_t topic_id;
|
|
503
|
+
} rd_kafka_topic_partition_private_t;
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Check if toppar is paused (consumer).
|
|
508
|
+
* Locks: toppar_lock() MUST be held.
|
|
509
|
+
*/
|
|
510
|
+
#define RD_KAFKA_TOPPAR_IS_PAUSED(rktp) \
|
|
511
|
+
((rktp)->rktp_flags & \
|
|
512
|
+
(RD_KAFKA_TOPPAR_F_APP_PAUSE | RD_KAFKA_TOPPAR_F_LIB_PAUSE))
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* @brief Increase refcount and return rktp object.
|
|
518
|
+
*/
|
|
519
|
+
#define rd_kafka_toppar_keep(RKTP) \
|
|
520
|
+
rd_kafka_toppar_keep0(__FUNCTION__, __LINE__, RKTP)
|
|
521
|
+
|
|
522
|
+
#define rd_kafka_toppar_keep_fl(FUNC, LINE, RKTP) \
|
|
523
|
+
rd_kafka_toppar_keep0(FUNC, LINE, RKTP)
|
|
524
|
+
|
|
525
|
+
static RD_UNUSED RD_INLINE rd_kafka_toppar_t *
|
|
526
|
+
rd_kafka_toppar_keep0(const char *func, int line, rd_kafka_toppar_t *rktp) {
|
|
527
|
+
rd_refcnt_add_fl(func, line, &rktp->rktp_refcnt);
|
|
528
|
+
return rktp;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
void rd_kafka_toppar_destroy_final(rd_kafka_toppar_t *rktp);
|
|
532
|
+
|
|
533
|
+
#define rd_kafka_toppar_destroy(RKTP) \
|
|
534
|
+
do { \
|
|
535
|
+
rd_kafka_toppar_t *_RKTP = (RKTP); \
|
|
536
|
+
if (unlikely(rd_refcnt_sub(&_RKTP->rktp_refcnt) == 0)) \
|
|
537
|
+
rd_kafka_toppar_destroy_final(_RKTP); \
|
|
538
|
+
} while (0)
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
|
|
542
|
+
#define rd_kafka_toppar_lock(rktp) mtx_lock(&(rktp)->rktp_lock)
|
|
543
|
+
#define rd_kafka_toppar_unlock(rktp) mtx_unlock(&(rktp)->rktp_lock)
|
|
544
|
+
|
|
545
|
+
static const char *
|
|
546
|
+
rd_kafka_toppar_name(const rd_kafka_toppar_t *rktp) RD_UNUSED;
|
|
547
|
+
static const char *rd_kafka_toppar_name(const rd_kafka_toppar_t *rktp) {
|
|
548
|
+
static RD_TLS char ret[256];
|
|
549
|
+
|
|
550
|
+
rd_snprintf(ret, sizeof(ret), "%.*s [%" PRId32 "]",
|
|
551
|
+
RD_KAFKAP_STR_PR(rktp->rktp_rkt->rkt_topic),
|
|
552
|
+
rktp->rktp_partition);
|
|
553
|
+
|
|
554
|
+
return ret;
|
|
555
|
+
}
|
|
556
|
+
rd_kafka_toppar_t *rd_kafka_toppar_new0(rd_kafka_topic_t *rkt,
|
|
557
|
+
int32_t partition,
|
|
558
|
+
const char *func,
|
|
559
|
+
int line);
|
|
560
|
+
#define rd_kafka_toppar_new(rkt, partition) \
|
|
561
|
+
rd_kafka_toppar_new0(rkt, partition, __FUNCTION__, __LINE__)
|
|
562
|
+
void rd_kafka_toppar_purge_and_disable_queues(rd_kafka_toppar_t *rktp);
|
|
563
|
+
void rd_kafka_toppar_set_fetch_state(rd_kafka_toppar_t *rktp, int fetch_state);
|
|
564
|
+
void rd_kafka_toppar_insert_msg(rd_kafka_toppar_t *rktp, rd_kafka_msg_t *rkm);
|
|
565
|
+
void rd_kafka_toppar_enq_msg(rd_kafka_toppar_t *rktp,
|
|
566
|
+
rd_kafka_msg_t *rkm,
|
|
567
|
+
rd_ts_t now);
|
|
568
|
+
int rd_kafka_retry_msgq(rd_kafka_msgq_t *destq,
|
|
569
|
+
rd_kafka_msgq_t *srcq,
|
|
570
|
+
int incr_retry,
|
|
571
|
+
int max_retries,
|
|
572
|
+
rd_ts_t backoff,
|
|
573
|
+
rd_kafka_msg_status_t status,
|
|
574
|
+
int (*cmp)(const void *a, const void *b),
|
|
575
|
+
rd_bool_t exponential_backoff,
|
|
576
|
+
int retry_ms,
|
|
577
|
+
int retry_max_ms);
|
|
578
|
+
void rd_kafka_msgq_insert_msgq(rd_kafka_msgq_t *destq,
|
|
579
|
+
rd_kafka_msgq_t *srcq,
|
|
580
|
+
int (*cmp)(const void *a, const void *b));
|
|
581
|
+
int rd_kafka_toppar_retry_msgq(rd_kafka_toppar_t *rktp,
|
|
582
|
+
rd_kafka_msgq_t *rkmq,
|
|
583
|
+
int incr_retry,
|
|
584
|
+
rd_kafka_msg_status_t status);
|
|
585
|
+
void rd_kafka_toppar_insert_msgq(rd_kafka_toppar_t *rktp,
|
|
586
|
+
rd_kafka_msgq_t *rkmq);
|
|
587
|
+
void rd_kafka_toppar_enq_error(rd_kafka_toppar_t *rktp,
|
|
588
|
+
rd_kafka_resp_err_t err,
|
|
589
|
+
const char *reason);
|
|
590
|
+
rd_kafka_toppar_t *rd_kafka_toppar_get0(const char *func,
|
|
591
|
+
int line,
|
|
592
|
+
const rd_kafka_topic_t *rkt,
|
|
593
|
+
int32_t partition,
|
|
594
|
+
int ua_on_miss);
|
|
595
|
+
#define rd_kafka_toppar_get(rkt, partition, ua_on_miss) \
|
|
596
|
+
rd_kafka_toppar_get0(__FUNCTION__, __LINE__, rkt, partition, ua_on_miss)
|
|
597
|
+
rd_kafka_toppar_t *rd_kafka_toppar_get2(rd_kafka_t *rk,
|
|
598
|
+
const char *topic,
|
|
599
|
+
int32_t partition,
|
|
600
|
+
int ua_on_miss,
|
|
601
|
+
int create_on_miss);
|
|
602
|
+
rd_kafka_toppar_t *rd_kafka_toppar_get_avail(const rd_kafka_topic_t *rkt,
|
|
603
|
+
int32_t partition,
|
|
604
|
+
int ua_on_miss,
|
|
605
|
+
rd_kafka_resp_err_t *errp);
|
|
606
|
+
|
|
607
|
+
rd_kafka_toppar_t *rd_kafka_toppar_desired_get(rd_kafka_topic_t *rkt,
|
|
608
|
+
int32_t partition);
|
|
609
|
+
void rd_kafka_toppar_desired_add0(rd_kafka_toppar_t *rktp);
|
|
610
|
+
rd_kafka_toppar_t *rd_kafka_toppar_desired_add(rd_kafka_topic_t *rkt,
|
|
611
|
+
int32_t partition);
|
|
612
|
+
void rd_kafka_toppar_desired_link(rd_kafka_toppar_t *rktp);
|
|
613
|
+
void rd_kafka_toppar_desired_unlink(rd_kafka_toppar_t *rktp);
|
|
614
|
+
void rd_kafka_toppar_desired_del(rd_kafka_toppar_t *rktp);
|
|
615
|
+
|
|
616
|
+
void rd_kafka_toppar_next_offset_handle(rd_kafka_toppar_t *rktp,
|
|
617
|
+
rd_kafka_fetch_pos_t next_pos);
|
|
618
|
+
|
|
619
|
+
void rd_kafka_toppar_broker_delegate(rd_kafka_toppar_t *rktp,
|
|
620
|
+
rd_kafka_broker_t *rkb);
|
|
621
|
+
|
|
622
|
+
|
|
623
|
+
rd_kafka_resp_err_t rd_kafka_toppar_op_fetch_start(rd_kafka_toppar_t *rktp,
|
|
624
|
+
rd_kafka_fetch_pos_t pos,
|
|
625
|
+
rd_kafka_q_t *fwdq,
|
|
626
|
+
rd_kafka_replyq_t replyq);
|
|
627
|
+
|
|
628
|
+
rd_kafka_resp_err_t rd_kafka_toppar_op_fetch_stop(rd_kafka_toppar_t *rktp,
|
|
629
|
+
rd_kafka_replyq_t replyq);
|
|
630
|
+
|
|
631
|
+
rd_kafka_resp_err_t rd_kafka_toppar_op_seek(rd_kafka_toppar_t *rktp,
|
|
632
|
+
rd_kafka_fetch_pos_t pos,
|
|
633
|
+
rd_kafka_replyq_t replyq);
|
|
634
|
+
|
|
635
|
+
rd_kafka_resp_err_t
|
|
636
|
+
rd_kafka_toppar_op_pause(rd_kafka_toppar_t *rktp, int pause, int flag);
|
|
637
|
+
|
|
638
|
+
void rd_kafka_toppar_fetch_stopped(rd_kafka_toppar_t *rktp,
|
|
639
|
+
rd_kafka_resp_err_t err);
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
|
|
643
|
+
rd_ts_t rd_kafka_broker_consumer_toppar_serve(rd_kafka_broker_t *rkb,
|
|
644
|
+
rd_kafka_toppar_t *rktp);
|
|
645
|
+
|
|
646
|
+
|
|
647
|
+
void rd_kafka_toppar_offset_fetch(rd_kafka_toppar_t *rktp,
|
|
648
|
+
rd_kafka_replyq_t replyq);
|
|
649
|
+
|
|
650
|
+
void rd_kafka_toppar_offset_request(rd_kafka_toppar_t *rktp,
|
|
651
|
+
rd_kafka_fetch_pos_t query_pos,
|
|
652
|
+
int backoff_ms);
|
|
653
|
+
|
|
654
|
+
void rd_kafka_toppar_purge_internal_fetch_queue_maybe(rd_kafka_toppar_t *rktp);
|
|
655
|
+
|
|
656
|
+
int rd_kafka_toppar_purge_queues(rd_kafka_toppar_t *rktp,
|
|
657
|
+
int purge_flags,
|
|
658
|
+
rd_bool_t include_xmit_msgq);
|
|
659
|
+
|
|
660
|
+
rd_kafka_broker_t *rd_kafka_toppar_broker(rd_kafka_toppar_t *rktp,
|
|
661
|
+
int proper_broker);
|
|
662
|
+
void rd_kafka_toppar_leader_unavailable(rd_kafka_toppar_t *rktp,
|
|
663
|
+
const char *reason,
|
|
664
|
+
rd_kafka_resp_err_t err);
|
|
665
|
+
|
|
666
|
+
void rd_kafka_toppar_pause(rd_kafka_toppar_t *rktp, int flag);
|
|
667
|
+
void rd_kafka_toppar_resume(rd_kafka_toppar_t *rktp, int flag);
|
|
668
|
+
|
|
669
|
+
rd_kafka_resp_err_t rd_kafka_toppar_op_pause_resume(rd_kafka_toppar_t *rktp,
|
|
670
|
+
int pause,
|
|
671
|
+
int flag,
|
|
672
|
+
rd_kafka_replyq_t replyq);
|
|
673
|
+
rd_kafka_resp_err_t
|
|
674
|
+
rd_kafka_toppars_pause_resume(rd_kafka_t *rk,
|
|
675
|
+
rd_bool_t pause,
|
|
676
|
+
rd_async_t async,
|
|
677
|
+
int flag,
|
|
678
|
+
rd_kafka_topic_partition_list_t *partitions);
|
|
679
|
+
|
|
680
|
+
|
|
681
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_new(const char *topic,
|
|
682
|
+
int32_t partition);
|
|
683
|
+
void rd_kafka_topic_partition_destroy_free(void *ptr);
|
|
684
|
+
rd_kafka_topic_partition_t *
|
|
685
|
+
rd_kafka_topic_partition_copy(const rd_kafka_topic_partition_t *src);
|
|
686
|
+
void *rd_kafka_topic_partition_copy_void(const void *src);
|
|
687
|
+
void rd_kafka_topic_partition_destroy_free(void *ptr);
|
|
688
|
+
rd_kafka_topic_partition_t *
|
|
689
|
+
rd_kafka_topic_partition_new_from_rktp(rd_kafka_toppar_t *rktp);
|
|
690
|
+
rd_kafka_topic_partition_t *
|
|
691
|
+
rd_kafka_topic_partition_new_with_topic_id(rd_kafka_Uuid_t topic_id,
|
|
692
|
+
int32_t partition);
|
|
693
|
+
void rd_kafka_topic_partition_set_topic_id(rd_kafka_topic_partition_t *rktpar,
|
|
694
|
+
rd_kafka_Uuid_t topic_id);
|
|
695
|
+
rd_kafka_Uuid_t
|
|
696
|
+
rd_kafka_topic_partition_get_topic_id(const rd_kafka_topic_partition_t *rktpar);
|
|
697
|
+
|
|
698
|
+
void rd_kafka_topic_partition_list_init(
|
|
699
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
700
|
+
int size);
|
|
701
|
+
void rd_kafka_topic_partition_list_destroy_free(void *ptr);
|
|
702
|
+
|
|
703
|
+
void rd_kafka_topic_partition_list_clear(
|
|
704
|
+
rd_kafka_topic_partition_list_t *rktparlist);
|
|
705
|
+
|
|
706
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_add0(
|
|
707
|
+
const char *func,
|
|
708
|
+
int line,
|
|
709
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
710
|
+
const char *topic,
|
|
711
|
+
int32_t partition,
|
|
712
|
+
rd_kafka_toppar_t *rktp,
|
|
713
|
+
const rd_kafka_topic_partition_private_t *parpriv);
|
|
714
|
+
|
|
715
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_add_with_topic_id(
|
|
716
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
717
|
+
rd_kafka_Uuid_t topic_id,
|
|
718
|
+
int32_t partition);
|
|
719
|
+
|
|
720
|
+
rd_kafka_topic_partition_t *
|
|
721
|
+
rd_kafka_topic_partition_list_add_with_topic_name_and_id(
|
|
722
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
723
|
+
rd_kafka_Uuid_t topic_id,
|
|
724
|
+
const char *topic,
|
|
725
|
+
int32_t partition);
|
|
726
|
+
|
|
727
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_upsert(
|
|
728
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
729
|
+
const char *topic,
|
|
730
|
+
int32_t partition);
|
|
731
|
+
|
|
732
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_add_copy(
|
|
733
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
734
|
+
const rd_kafka_topic_partition_t *rktpar);
|
|
735
|
+
|
|
736
|
+
|
|
737
|
+
void rd_kafka_topic_partition_list_add_list(
|
|
738
|
+
rd_kafka_topic_partition_list_t *dst,
|
|
739
|
+
const rd_kafka_topic_partition_list_t *src);
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Traverse rd_kafka_topic_partition_list_t.
|
|
743
|
+
*
|
|
744
|
+
* @warning \p TPLIST modifications are not allowed.
|
|
745
|
+
*/
|
|
746
|
+
#define RD_KAFKA_TPLIST_FOREACH(RKTPAR, TPLIST) \
|
|
747
|
+
for (RKTPAR = &(TPLIST)->elems[0]; \
|
|
748
|
+
(RKTPAR) < &(TPLIST)->elems[(TPLIST)->cnt]; RKTPAR++)
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* Traverse rd_kafka_topic_partition_list_t.
|
|
752
|
+
*
|
|
753
|
+
* @warning \p TPLIST modifications are not allowed, but removal of the
|
|
754
|
+
* current \p RKTPAR element is allowed.
|
|
755
|
+
*/
|
|
756
|
+
#define RD_KAFKA_TPLIST_FOREACH_REVERSE(RKTPAR, TPLIST) \
|
|
757
|
+
for (RKTPAR = &(TPLIST)->elems[(TPLIST)->cnt - 1]; \
|
|
758
|
+
(RKTPAR) >= &(TPLIST)->elems[0]; RKTPAR--)
|
|
759
|
+
|
|
760
|
+
int rd_kafka_topic_partition_match(rd_kafka_t *rk,
|
|
761
|
+
const rd_kafka_group_member_t *rkgm,
|
|
762
|
+
const rd_kafka_topic_partition_t *rktpar,
|
|
763
|
+
const char *topic,
|
|
764
|
+
int *matched_by_regex);
|
|
765
|
+
|
|
766
|
+
|
|
767
|
+
int rd_kafka_topic_partition_cmp(const void *_a, const void *_b);
|
|
768
|
+
int rd_kafka_topic_partition_by_id_cmp(const void *_a, const void *_b);
|
|
769
|
+
unsigned int rd_kafka_topic_partition_hash(const void *a);
|
|
770
|
+
|
|
771
|
+
int rd_kafka_topic_partition_list_find_idx(
|
|
772
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
773
|
+
const char *topic,
|
|
774
|
+
int32_t partition);
|
|
775
|
+
|
|
776
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_find_by_id(
|
|
777
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
778
|
+
rd_kafka_Uuid_t topic_id,
|
|
779
|
+
int32_t partition);
|
|
780
|
+
|
|
781
|
+
int rd_kafka_topic_partition_list_find_idx_by_id(
|
|
782
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
783
|
+
rd_kafka_Uuid_t topic_id,
|
|
784
|
+
int32_t partition);
|
|
785
|
+
|
|
786
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_find_topic_by_name(
|
|
787
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
788
|
+
const char *topic);
|
|
789
|
+
|
|
790
|
+
rd_kafka_topic_partition_t *rd_kafka_topic_partition_list_find_topic_by_id(
|
|
791
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
792
|
+
rd_kafka_Uuid_t topic_id);
|
|
793
|
+
|
|
794
|
+
void rd_kafka_topic_partition_list_sort_by_topic(
|
|
795
|
+
rd_kafka_topic_partition_list_t *rktparlist);
|
|
796
|
+
|
|
797
|
+
void rd_kafka_topic_partition_list_sort_by_topic_id(
|
|
798
|
+
rd_kafka_topic_partition_list_t *rktparlist);
|
|
799
|
+
|
|
800
|
+
void rd_kafka_topic_partition_list_reset_offsets(
|
|
801
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
802
|
+
int64_t offset);
|
|
803
|
+
|
|
804
|
+
int rd_kafka_topic_partition_list_set_offsets(
|
|
805
|
+
rd_kafka_t *rk,
|
|
806
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
807
|
+
int from_rktp,
|
|
808
|
+
int64_t def_value,
|
|
809
|
+
int is_commit);
|
|
810
|
+
|
|
811
|
+
int rd_kafka_topic_partition_list_count_abs_offsets(
|
|
812
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
813
|
+
|
|
814
|
+
int rd_kafka_topic_partition_list_cmp(const void *_a,
|
|
815
|
+
const void *_b,
|
|
816
|
+
int (*cmp)(const void *, const void *));
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Creates a new empty topic partition private.
|
|
820
|
+
*
|
|
821
|
+
* @remark This struct is dynamically allocated and hence should be freed.
|
|
822
|
+
*/
|
|
823
|
+
static RD_UNUSED RD_INLINE rd_kafka_topic_partition_private_t *
|
|
824
|
+
rd_kafka_topic_partition_private_new() {
|
|
825
|
+
rd_kafka_topic_partition_private_t *parpriv;
|
|
826
|
+
parpriv = rd_calloc(1, sizeof(*parpriv));
|
|
827
|
+
parpriv->leader_epoch = -1;
|
|
828
|
+
parpriv->current_leader_epoch = -1;
|
|
829
|
+
return parpriv;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* @returns (and creates if necessary) the ._private glue object.
|
|
834
|
+
*/
|
|
835
|
+
static RD_UNUSED RD_INLINE rd_kafka_topic_partition_private_t *
|
|
836
|
+
rd_kafka_topic_partition_get_private(rd_kafka_topic_partition_t *rktpar) {
|
|
837
|
+
rd_kafka_topic_partition_private_t *parpriv;
|
|
838
|
+
|
|
839
|
+
if (!(parpriv = rktpar->_private)) {
|
|
840
|
+
parpriv = rd_kafka_topic_partition_private_new();
|
|
841
|
+
rktpar->_private = parpriv;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
return parpriv;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
/**
|
|
849
|
+
* @returns the partition leader current epoch, if relevant and known,
|
|
850
|
+
* else -1.
|
|
851
|
+
*
|
|
852
|
+
* @param rktpar Partition object.
|
|
853
|
+
*
|
|
854
|
+
* @remark See KIP-320 for more information.
|
|
855
|
+
*/
|
|
856
|
+
int32_t rd_kafka_topic_partition_get_current_leader_epoch(
|
|
857
|
+
const rd_kafka_topic_partition_t *rktpar);
|
|
858
|
+
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* @brief Sets the partition leader current epoch (use -1 to clear).
|
|
862
|
+
*
|
|
863
|
+
* @param rktpar Partition object.
|
|
864
|
+
* @param leader_epoch Partition leader current epoch, use -1 to reset.
|
|
865
|
+
*
|
|
866
|
+
* @remark See KIP-320 for more information.
|
|
867
|
+
*/
|
|
868
|
+
void rd_kafka_topic_partition_set_current_leader_epoch(
|
|
869
|
+
rd_kafka_topic_partition_t *rktpar,
|
|
870
|
+
int32_t leader_epoch);
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* @returns the partition's rktp if set (no refcnt increase), else NULL.
|
|
874
|
+
*/
|
|
875
|
+
static RD_INLINE RD_UNUSED rd_kafka_toppar_t *
|
|
876
|
+
rd_kafka_topic_partition_toppar(rd_kafka_t *rk,
|
|
877
|
+
const rd_kafka_topic_partition_t *rktpar) {
|
|
878
|
+
const rd_kafka_topic_partition_private_t *parpriv;
|
|
879
|
+
|
|
880
|
+
if ((parpriv = rktpar->_private))
|
|
881
|
+
return parpriv->rktp;
|
|
882
|
+
|
|
883
|
+
return NULL;
|
|
884
|
+
}
|
|
885
|
+
|
|
886
|
+
rd_kafka_toppar_t *
|
|
887
|
+
rd_kafka_topic_partition_ensure_toppar(rd_kafka_t *rk,
|
|
888
|
+
rd_kafka_topic_partition_t *rktpar,
|
|
889
|
+
rd_bool_t create_on_miss);
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* @returns (and sets if necessary) the \p rktpar's ._private.
|
|
893
|
+
* @remark a new reference is returned.
|
|
894
|
+
*/
|
|
895
|
+
static RD_INLINE RD_UNUSED rd_kafka_toppar_t *
|
|
896
|
+
rd_kafka_topic_partition_get_toppar(rd_kafka_t *rk,
|
|
897
|
+
rd_kafka_topic_partition_t *rktpar,
|
|
898
|
+
rd_bool_t create_on_miss) {
|
|
899
|
+
rd_kafka_toppar_t *rktp;
|
|
900
|
+
|
|
901
|
+
rktp =
|
|
902
|
+
rd_kafka_topic_partition_ensure_toppar(rk, rktpar, create_on_miss);
|
|
903
|
+
|
|
904
|
+
if (rktp)
|
|
905
|
+
rd_kafka_toppar_keep(rktp);
|
|
906
|
+
|
|
907
|
+
return rktp;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
void rd_kafka_topic_partition_list_update_toppars(
|
|
913
|
+
rd_kafka_t *rk,
|
|
914
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
915
|
+
rd_bool_t create_on_miss);
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
void rd_kafka_topic_partition_list_query_leaders_async(
|
|
919
|
+
rd_kafka_t *rk,
|
|
920
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
921
|
+
int timeout_ms,
|
|
922
|
+
rd_kafka_replyq_t replyq,
|
|
923
|
+
rd_kafka_op_cb_t *cb,
|
|
924
|
+
void *opaque);
|
|
925
|
+
|
|
926
|
+
rd_kafka_resp_err_t rd_kafka_topic_partition_list_query_leaders(
|
|
927
|
+
rd_kafka_t *rk,
|
|
928
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
929
|
+
rd_list_t *leaders,
|
|
930
|
+
int timeout_ms);
|
|
931
|
+
|
|
932
|
+
int rd_kafka_topic_partition_list_get_topics(
|
|
933
|
+
rd_kafka_t *rk,
|
|
934
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
935
|
+
rd_list_t *rkts);
|
|
936
|
+
|
|
937
|
+
int rd_kafka_topic_partition_list_get_topic_names(
|
|
938
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
939
|
+
rd_list_t *topics,
|
|
940
|
+
int include_regex);
|
|
941
|
+
|
|
942
|
+
void rd_kafka_topic_partition_list_log(
|
|
943
|
+
rd_kafka_t *rk,
|
|
944
|
+
const char *fac,
|
|
945
|
+
int dbg,
|
|
946
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
947
|
+
|
|
948
|
+
#define RD_KAFKA_FMT_F_OFFSET 0x1 /* Print offset */
|
|
949
|
+
#define RD_KAFKA_FMT_F_ONLY_ERR 0x2 /* Only include errored entries */
|
|
950
|
+
#define RD_KAFKA_FMT_F_NO_ERR 0x4 /* Dont print error string */
|
|
951
|
+
const char *rd_kafka_topic_partition_list_str(
|
|
952
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
953
|
+
char *dest,
|
|
954
|
+
size_t dest_size,
|
|
955
|
+
int fmt_flags);
|
|
956
|
+
|
|
957
|
+
void rd_kafka_topic_partition_list_update(
|
|
958
|
+
rd_kafka_topic_partition_list_t *dst,
|
|
959
|
+
const rd_kafka_topic_partition_list_t *src);
|
|
960
|
+
|
|
961
|
+
int rd_kafka_topic_partition_leader_cmp(const void *_a, const void *_b);
|
|
962
|
+
|
|
963
|
+
void rd_kafka_topic_partition_set_from_fetch_pos(
|
|
964
|
+
rd_kafka_topic_partition_t *rktpar,
|
|
965
|
+
const rd_kafka_fetch_pos_t fetchpos);
|
|
966
|
+
|
|
967
|
+
void rd_kafka_topic_partition_set_metadata_from_rktp_stored(
|
|
968
|
+
rd_kafka_topic_partition_t *rktpar,
|
|
969
|
+
const rd_kafka_toppar_t *rktp);
|
|
970
|
+
|
|
971
|
+
static RD_UNUSED rd_kafka_fetch_pos_t rd_kafka_topic_partition_get_fetch_pos(
|
|
972
|
+
const rd_kafka_topic_partition_t *rktpar) {
|
|
973
|
+
rd_kafka_fetch_pos_t fetchpos = {
|
|
974
|
+
rktpar->offset, rd_kafka_topic_partition_get_leader_epoch(rktpar)};
|
|
975
|
+
|
|
976
|
+
return fetchpos;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
|
|
980
|
+
/**
|
|
981
|
+
* @brief Match function that returns true if partition has a valid offset.
|
|
982
|
+
*/
|
|
983
|
+
static RD_UNUSED int
|
|
984
|
+
rd_kafka_topic_partition_match_valid_offset(const void *elem,
|
|
985
|
+
const void *opaque) {
|
|
986
|
+
const rd_kafka_topic_partition_t *rktpar = elem;
|
|
987
|
+
return rktpar->offset >= 0;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
rd_kafka_topic_partition_list_t *rd_kafka_topic_partition_list_match(
|
|
991
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
992
|
+
int (*match)(const void *elem, const void *opaque),
|
|
993
|
+
void *opaque);
|
|
994
|
+
|
|
995
|
+
size_t rd_kafka_topic_partition_list_sum(
|
|
996
|
+
const rd_kafka_topic_partition_list_t *rktparlist,
|
|
997
|
+
size_t (*cb)(const rd_kafka_topic_partition_t *rktpar, void *opaque),
|
|
998
|
+
void *opaque);
|
|
999
|
+
|
|
1000
|
+
rd_bool_t rd_kafka_topic_partition_list_has_duplicates(
|
|
1001
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
1002
|
+
rd_bool_t ignore_partition);
|
|
1003
|
+
|
|
1004
|
+
void rd_kafka_topic_partition_list_set_err(
|
|
1005
|
+
rd_kafka_topic_partition_list_t *rktparlist,
|
|
1006
|
+
rd_kafka_resp_err_t err);
|
|
1007
|
+
|
|
1008
|
+
rd_kafka_resp_err_t rd_kafka_topic_partition_list_get_err(
|
|
1009
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
1010
|
+
|
|
1011
|
+
int rd_kafka_topic_partition_list_regex_cnt(
|
|
1012
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
1013
|
+
|
|
1014
|
+
rd_kafka_topic_partition_list_t *rd_kafka_topic_partition_list_remove_regexes(
|
|
1015
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
1016
|
+
|
|
1017
|
+
rd_kafkap_str_t *rd_kafka_topic_partition_list_combine_regexes(
|
|
1018
|
+
const rd_kafka_topic_partition_list_t *rktparlist);
|
|
1019
|
+
|
|
1020
|
+
void *rd_kafka_topic_partition_list_copy_opaque(const void *src, void *opaque);
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* @brief Toppar + Op version tuple used for mapping Fetched partitions
|
|
1024
|
+
* back to their fetch versions.
|
|
1025
|
+
*/
|
|
1026
|
+
struct rd_kafka_toppar_ver {
|
|
1027
|
+
rd_kafka_toppar_t *rktp;
|
|
1028
|
+
int32_t version;
|
|
1029
|
+
};
|
|
1030
|
+
|
|
1031
|
+
|
|
1032
|
+
/**
|
|
1033
|
+
* @brief Toppar + Op version comparator.
|
|
1034
|
+
*/
|
|
1035
|
+
static RD_INLINE RD_UNUSED int rd_kafka_toppar_ver_cmp(const void *_a,
|
|
1036
|
+
const void *_b) {
|
|
1037
|
+
const struct rd_kafka_toppar_ver *a = _a, *b = _b;
|
|
1038
|
+
const rd_kafka_toppar_t *rktp_a = a->rktp;
|
|
1039
|
+
const rd_kafka_toppar_t *rktp_b = b->rktp;
|
|
1040
|
+
int r;
|
|
1041
|
+
|
|
1042
|
+
if (rktp_a->rktp_rkt != rktp_b->rktp_rkt &&
|
|
1043
|
+
(r = rd_kafkap_str_cmp(rktp_a->rktp_rkt->rkt_topic,
|
|
1044
|
+
rktp_b->rktp_rkt->rkt_topic)))
|
|
1045
|
+
return r;
|
|
1046
|
+
|
|
1047
|
+
return RD_CMP(rktp_a->rktp_partition, rktp_b->rktp_partition);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* @brief Frees up resources for \p tver but not the \p tver itself.
|
|
1052
|
+
*/
|
|
1053
|
+
static RD_INLINE RD_UNUSED void
|
|
1054
|
+
rd_kafka_toppar_ver_destroy(struct rd_kafka_toppar_ver *tver) {
|
|
1055
|
+
rd_kafka_toppar_destroy(tver->rktp);
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1058
|
+
|
|
1059
|
+
/**
|
|
1060
|
+
* @returns 1 if rko version is outdated, else 0.
|
|
1061
|
+
*/
|
|
1062
|
+
static RD_INLINE RD_UNUSED int rd_kafka_op_version_outdated(rd_kafka_op_t *rko,
|
|
1063
|
+
int version) {
|
|
1064
|
+
if (!rko->rko_version)
|
|
1065
|
+
return 0;
|
|
1066
|
+
|
|
1067
|
+
if (version)
|
|
1068
|
+
return rko->rko_version < version;
|
|
1069
|
+
|
|
1070
|
+
if (rko->rko_rktp)
|
|
1071
|
+
return rko->rko_version <
|
|
1072
|
+
rd_atomic32_get(&rko->rko_rktp->rktp_version);
|
|
1073
|
+
return 0;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
void rd_kafka_toppar_offset_commit_result(
|
|
1077
|
+
rd_kafka_toppar_t *rktp,
|
|
1078
|
+
rd_kafka_resp_err_t err,
|
|
1079
|
+
rd_kafka_topic_partition_list_t *offsets);
|
|
1080
|
+
|
|
1081
|
+
void rd_kafka_toppar_broker_leave_for_remove(rd_kafka_toppar_t *rktp);
|
|
1082
|
+
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* @brief Represents a leader and the partitions it is leader for.
|
|
1086
|
+
*/
|
|
1087
|
+
struct rd_kafka_partition_leader {
|
|
1088
|
+
rd_kafka_broker_t *rkb;
|
|
1089
|
+
rd_kafka_topic_partition_list_t *partitions;
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
static RD_UNUSED void
|
|
1093
|
+
rd_kafka_partition_leader_destroy(struct rd_kafka_partition_leader *leader) {
|
|
1094
|
+
rd_kafka_broker_destroy(leader->rkb);
|
|
1095
|
+
rd_kafka_topic_partition_list_destroy(leader->partitions);
|
|
1096
|
+
rd_free(leader);
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
void rd_kafka_partition_leader_destroy_free(void *ptr);
|
|
1100
|
+
|
|
1101
|
+
static RD_UNUSED struct rd_kafka_partition_leader *
|
|
1102
|
+
rd_kafka_partition_leader_new(rd_kafka_broker_t *rkb) {
|
|
1103
|
+
struct rd_kafka_partition_leader *leader = rd_malloc(sizeof(*leader));
|
|
1104
|
+
leader->rkb = rkb;
|
|
1105
|
+
rd_kafka_broker_keep(rkb);
|
|
1106
|
+
leader->partitions = rd_kafka_topic_partition_list_new(0);
|
|
1107
|
+
return leader;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
static RD_UNUSED int rd_kafka_partition_leader_cmp(const void *_a,
|
|
1111
|
+
const void *_b) {
|
|
1112
|
+
const struct rd_kafka_partition_leader *a = _a, *b = _b;
|
|
1113
|
+
return rd_kafka_broker_cmp(a->rkb, b->rkb);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
|
|
1117
|
+
int rd_kafka_toppar_pid_change(rd_kafka_toppar_t *rktp,
|
|
1118
|
+
rd_kafka_pid_t pid,
|
|
1119
|
+
uint64_t base_msgid);
|
|
1120
|
+
|
|
1121
|
+
int rd_kafka_toppar_handle_purge_queues(rd_kafka_toppar_t *rktp,
|
|
1122
|
+
rd_kafka_broker_t *rkb,
|
|
1123
|
+
int purge_flags);
|
|
1124
|
+
void rd_kafka_purge_ua_toppar_queues(rd_kafka_t *rk);
|
|
1125
|
+
|
|
1126
|
+
static RD_UNUSED int rd_kafka_toppar_topic_cmp(const void *_a, const void *_b) {
|
|
1127
|
+
const rd_kafka_toppar_t *a = _a, *b = _b;
|
|
1128
|
+
return strcmp(a->rktp_rkt->rkt_topic->str, b->rktp_rkt->rkt_topic->str);
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
/**
|
|
1133
|
+
* @brief Set's the partitions next fetch position, i.e., the next offset
|
|
1134
|
+
* to start fetching from.
|
|
1135
|
+
*
|
|
1136
|
+
* @locks rd_kafka_toppar_lock(rktp) MUST be held.
|
|
1137
|
+
*/
|
|
1138
|
+
static RD_UNUSED RD_INLINE void
|
|
1139
|
+
rd_kafka_toppar_set_next_fetch_position(rd_kafka_toppar_t *rktp,
|
|
1140
|
+
rd_kafka_fetch_pos_t next_pos) {
|
|
1141
|
+
rktp->rktp_next_fetch_start = next_pos;
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
/**
|
|
1145
|
+
* @brief Sets the offset validation position.
|
|
1146
|
+
*
|
|
1147
|
+
* @locks rd_kafka_toppar_lock(rktp) MUST be held.
|
|
1148
|
+
*/
|
|
1149
|
+
static RD_UNUSED RD_INLINE void rd_kafka_toppar_set_offset_validation_position(
|
|
1150
|
+
rd_kafka_toppar_t *rktp,
|
|
1151
|
+
rd_kafka_fetch_pos_t offset_validation_pos) {
|
|
1152
|
+
rktp->rktp_offset_validation_pos = offset_validation_pos;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
rd_kafka_topic_partition_list_t *
|
|
1156
|
+
rd_kafka_topic_partition_list_intersection_by_name(
|
|
1157
|
+
rd_kafka_topic_partition_list_t *a,
|
|
1158
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1159
|
+
|
|
1160
|
+
rd_kafka_topic_partition_list_t *
|
|
1161
|
+
rd_kafka_topic_partition_list_difference_by_name(
|
|
1162
|
+
rd_kafka_topic_partition_list_t *a,
|
|
1163
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1164
|
+
|
|
1165
|
+
rd_kafka_topic_partition_list_t *
|
|
1166
|
+
rd_kafka_topic_partition_list_union_by_name(rd_kafka_topic_partition_list_t *a,
|
|
1167
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1168
|
+
|
|
1169
|
+
rd_kafka_topic_partition_list_t *
|
|
1170
|
+
rd_kafka_topic_partition_list_intersection_by_id(
|
|
1171
|
+
rd_kafka_topic_partition_list_t *a,
|
|
1172
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1173
|
+
|
|
1174
|
+
rd_kafka_topic_partition_list_t *rd_kafka_topic_partition_list_difference_by_id(
|
|
1175
|
+
rd_kafka_topic_partition_list_t *a,
|
|
1176
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1177
|
+
|
|
1178
|
+
rd_kafka_topic_partition_list_t *
|
|
1179
|
+
rd_kafka_topic_partition_list_union_by_id(rd_kafka_topic_partition_list_t *a,
|
|
1180
|
+
rd_kafka_topic_partition_list_t *b);
|
|
1181
|
+
|
|
1182
|
+
#endif /* _RDKAFKA_PARTITION_H_ */
|