Hi I was wondering how flink would execute these ...
# random
a
Hi I was wondering how flink would execute these two flows in a single app:
Copy code
sourceA -> mapFunctionA1 -> mapFunctionX1 -> mapFunctionX2 -> mapFunctionA2 -> sinkA -> sinkB
sourceB -> mapFunctionX1 -> mapFunctionX2 -> sinkB
As you can see X1 and X2 are common in these two flows so I am wondering, will Flink share the tasks across them such that events coming from both sources are processed by same group of tasks or will they be treated differently by Flink and events will flow into different versions of X1 and X2 for source A and B?
c
X1 and X2 will not be shared.
If anything the only shared thing is sinkB, IF you tell flink to union the streams before it.
Mind you that you could tell Flink to share X1 and X2, by unioning the input streams and splitting the output again. But it's more hassle than its worth I imagine.
a
Ohh, Got it. Thank you.
A follow of question on this if you could help.. If I set execution environment parallelism or system parallelism as 10. Will both sources and their respective map/sink functions take 10 each or will they split it as 5 each since there are two streams? I am guessing everyone will take 10 irrespective of how many events are coming to source A or B unless I explicitly set them for each myself?
c
I am guessing everyone will take 10 irrespective of how many events are coming to source A or B unless I explicitly set them for each myself?
Correct!
a
Got it. Thanks!