Why “broadcast state” can store the dynamic rules however broadcast() operator cannot?

久未见 提交于 2019-12-08 12:28:38

问题


I got confused for the difference between "broadcast state" and broadcast() operator, and finally I got the help from a Flink expert in the following thread.

What does it mean that "broadcast state" unblocks the implementation of the “dynamic patterns” feature for Flink’s CEP library?

In the end it seems got the conclusion that "broadcast state" can store the dynamic rules in the keyed stream by RichCoFlatMap , however broadcast() operator cannot, so may I know how "broadcast state" store the dynamic rules by RichCoFlatMap and why broadcast() operator cannot store the dynamic rules by RichCoFlatMap? May I got am example for explaining it?


回答1:


Those are completely two different concepts. Moreover the broadcast() is kind of a prerequisite for BroadcastState.

broadcast() specifies partitioning of data, that says that each element of the stream should be broadcasted to each parallel downstream operator.

BroadcastState is a state of operator that first of all allows to be read-write from a broadcasted stream and read from non-broadcasted one. Before that there was no way to join such two streams. Moreover this state will ensure that after restore each instance of the state across all parallel instances will be the same.

For more information on the BroadcastState have look into this docs.



来源:https://stackoverflow.com/questions/50570605/why-broadcast-state-can-store-the-dynamic-rules-however-broadcast-operator-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!