在不中断执行的情况下更改Flink中的源函数 [英] Change source function in Flink without interrupting the execution

查看:131
本文介绍了在不中断执行的情况下更改Flink中的源函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种解决方案,可以在执行过程中更改Flink中的源函数:

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

SourceFunction<String> mySource = ...; // this a function that I want to change during runtime;
DataStream<String> stream = env.addSource(mySource); 

stream.map(...).print(); // creating my stream

env.execute("sample");

我正在考虑围绕SourceFunction的实际实现创建包装,它将在需要时替换幕后的实现,但遇到了SourceContext的概念.

解决方案

Flink Forward上有一个演讲,探讨了一些相关问题.我认为您会发现它很有帮助.请参见 Apache Flink中的引导状态./p>

I am looking for a solution how I can change a source function in Flink while execution is in progress:

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();

SourceFunction<String> mySource = ...; // this a function that I want to change during runtime;
DataStream<String> stream = env.addSource(mySource); 

stream.map(...).print(); // creating my stream

env.execute("sample");

I am thinking about creating a wrapper around a real implementation of SourceFunction that will replace the implementation behind the scenes when needed but come across a notion of SourceContext.

解决方案

There was a talk at Flink Forward that looked at some related issues. I think you'd find it helpful. See Bootstrapping State In Apache Flink.

这篇关于在不中断执行的情况下更改Flink中的源函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆