简体   繁体   English

Kafka Streams:内部主题分区

[英]Kafka Streams: Internal topic partitions

Kafka version: 1.0.0卡夫卡版本:1.0.0
Let's say the stream application uses low level processor API which maintains the state and reads from a topic with 10 partitions.假设流应用程序使用低级处理器 API,它维护状态并从具有 10 个分区的主题中读取。 Please clarify if the internal topic is expected to be created with the same number of partitions OR is it per the broker default.请澄清内部主题是否应使用相同数量的分区创建,或者是根据代理默认值创建的。 If it's the later, if we need to increase the partitions of the internal topic, is there any option?如果是后者,如果我们需要增加内部主题的分区,有什么办法吗?

Kafka Streams will create the topic for you. Kafka Streams 将为您创建主题。 And yes, it will create it with the same number of partitions as your input topic.是的,它会使用与您的输入主题相同数量的分区来创建它。 During startup, Kafka Streams also checks if the topic has the expected number of partitions and fails if not.在启动期间,Kafka Streams 还会检查主题是否具有预期的分区数,如果没有则失败。

The internal topic is basically a regular topic as any other and you can change the number of partitions via command line tools like for any other topic.内部主题基本上是一个常规主题,您可以像任何其他主题一样通过命令行工具更改分区数。 However, this should never be required.但是,这绝不应该是必需的。 Also note, that dropping/adding partitions, will mess up your state.另请注意,删除/添加分区会弄乱您的状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM