I have a Flink job with the classic shape of datasource-operator1-operatorN-sink
.
From what I can observe, the open()
method of operator1
is invoked before the open()
method of the datasource
.
In the open()
method of operator1
I need to handle some business logic, that it is dependent of stuff which gets resolved at datasource.open()
1- Is there any way that I can restrain that the operator1.open()
is not invoked until datasource.open()
is?
2- Is there any way to communicate/signal from the datasource.open()
method, to the operator1.open()
method?
Trying to establish some sort of out-of-band communication between operators often gets folks into trouble. At best it can screw up performance, and at worst it can lead to deadlocks.
What you might try instead is to rely on the signaling pathway that already exists between the data source and the async function -- in other words, emit a specially encoded event from the data source that tells the async function it can start now, and have the async function wait for that special record before doing other processing.