重新连接如何在Kafka流中工作?

发布于 2025-01-31 12:31:49 字数 447 浏览 4 评论 0原文

NOOB问题,但是当您在Kafka流中重新关注主题时会发生什么?

例如,假设我想实现WordCount,类似于 htttps:htttps:// docs .confluent.io/4.1.1/streams/quickstart.html ,在某个步骤中,您可以通过单词来键入主题,并根据数量减少。

如果源主题有10个分区& Kafka群集中有10个实例,最终单词计数是实际计数的1/10,还是它具有正确的计数?如果是后者,那怎么到了?

在我想的用例中,我有一个我想进行陈述的处理的无关主题,但是我不确定GroupByKey或某些东西是否会神奇地实现这一目标。

谢谢!

Noob question, but what is happening when you re-key a topic in Kafka Streams?

For example, let's say I want to implement WordCount, similar to https://docs.confluent.io/4.1.1/streams/quickstart.html, there's a step where you would key the topic by word, and reduce by count.

If the source topic had 10 partitions & there are 10 instances in a Kafka cluster, will the final word count be 1/10 of the actual counts, or will it have the correct count? If it's the latter, how does that happen exactly?

In the use-case I'm thinking of, I have an unkeyed topic that I want to do stateful processing on, but I'm not sure if groupByKey or something can magically make that happen.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

聚集的泪 2025-02-07 12:31:49

我认为您无法通过一个非钥匙主题来实现这一目标。它肯定会产生随机结果,或者有一些全球状态存储的概念,可用于在同一消费者组中的各个实例共享状态。

I don't think you can achieve this with a non-key topic. It will surely generate random result, or there is some concept of global state store which can be used to share state across instances in same same consumer group.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文