简体   繁体   English

全局状态存储与 kafka 中的普通状态存储有何不同?

[英]How global state store differ from normal state store in kafka?

How Global State Store differ from normal state store?全局状态存储与普通状态存储有何不同?

Is Global state store has copy of data in all the instance running on different machine?全局状态存储是否在不同机器上运行的所有实例中都有数据副本? How it behave in case of restart because global state store doesn't use any change-log topic for restore in my scenario the source topic from the global store has no key.在重新启动的情况下它的行为,因为在我的场景中,全局状态存储不使用任何更改日志主题进行还原,全局存储中的源主题没有键。

  1. Is Global state store has copy of data in all the instance running on different machine?全局状态存储是否在不同机器上运行的所有实例中都有数据副本?

    Yes.是的。

  2. How it behave in case of restart because global state store doesn't use any change-log topic for restore in my scenario the source topic from the global store has no key:在重新启动的情况下它的行为,因为在我的场景中,全局状态存储不使用任何更改日志主题进行还原,全局存储中的源主题没有键:
    • GlobalKTable disable logging by default so it'll not push changelog to the changelog topic for GlobalKTable (it still creates the changelog topic though). GlobalKTable默认禁用日志记录,因此它不会将GlobalKTable日志推送到GlobalKTable日志主题(尽管它仍然会创建GlobalKTable日志主题)。 You have to re-populate data to GlobalKTable from an input topic which enables log compaction (cleanup.policy=compact) which message's key is the key you want to lookup in your GlobalKTable .您必须从启用日志压缩 (cleanup.policy=compact) 的输入主题将数据重新填充到GlobalKTable ,其中消息的键是您要在GlobalKTable查找的GlobalKTable Kafka Stream will just re-populate data from the input topic to GlobalKTable when you restart application.当您重新启动应用程序时,Kafka Stream 只会将数据从输入主题重新填充到GlobalKTable
    • in my scenario the source topic from the global store has no key: you have to map your source topic to the new topic which I mentioned above using a KeyValueMapper, and enable log compaction on the output topic.在我的场景中,来自全局存储的源主题没有键:您必须使用 KeyValueMapper 将源主题映射到我上面提到的新主题,并在输出主题上启用日志压缩。

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

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