Share state among operators in Flink

自闭症网瘾萝莉.ら 提交于 2019-12-03 21:20:07

问题


I wonder if it is possible in Flink to share the state among operators.

Say, for instance, that I have partitioning by key on an operator and I need a piece of state of partition A inside partition C (for any reason) (fig 1.a), or I need the state of operator C in downstream operator F (fig 1.b).

I know it is possible to broadcast records to all partitions. So, if you include the internal state of an operator inside the records, you can share your internal state with downstream operators.
However, this could be an expensive operation instead of simply letting op1 specifically ask for op2 state.

Are the recent developments around queryable state moving towards this concept or they are meant only to let an external user query the internal state of the topology?

Thank you in advance for your insights


回答1:


In general, Flink's design does not allow to read from or write to state of other subtasks of the same or different operators. As you said, you can use broadcast to make state globally available. The queryable state features is intended for external user queries.

However, I heard of users who leveraged this features in an operator to fetch data from other operators of the same job. I don't know how well this works (stability and performance-wise). I would point you to the user mailing list for a more in-depth technical discussion if you would like to try this out.



来源:https://stackoverflow.com/questions/40015086/share-state-among-operators-in-flink

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