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

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

问题描述

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

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");

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

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.

推荐答案

在 Flink Forward 上有一个演讲,讨论了一些相关问题.我想你会发现它很有帮助.请参阅 Apache Flink 中的引导状态.

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天全站免登陆