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
.