Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
534 views
in Technique[技术] by (71.8m points)

flink DataStream算子中如何实时更新变量?

图片.png
我在第一个map需要用到变量currentCenter,然后我输出的结果需要更新currentCenter(最后一个map),但是没办法更新,有什么办法更新吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

使用数据库、文件都可以解决此问题。但使得算法退化成频繁的io读取算法,所以最后采用了迭代流+广播流的解决方法,动态更新变量!更多介绍看文章:https://ostack.cn/a/11...


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...