0
votes

Assume I have a config stream which I would like to broadcast to all instances of process operators and I have another non-keyed input stream. I want to have such ProcessFunction/WindowFunction that can take the config stream and the input stream and can periodically process cached inputs.

I know one solution would be using KeyedProcessFunction with a hardcoded key. (Maybe I am wrong) But I am trying to avoid using it because I think ProcessFunction would save network transmission since inputs will be evenly distributed to all instances of the process function in different task managers.

Any help will be appreciated!

1

1 Answers

0
votes

Have a try with BroadcastStream: https://ci.apache.org/projects/flink/flink-docs-stable/dev/stream/state/broadcast_state.html. It works with keyed or non-keyed stream. The example in the documents demonstrates its typical usage: broadcast a pattern(e.g. your config stream) to a keyed stream(can be non-keyed stream, e.g. your input stream).