title: Flink app-level barriers
body: <p>I'm trying to figure out what's the proper way to make kind of a barrier on merging multiple streams in Flink.</p>
  
  <p>So let's say I have 4 keyed streams each calculating some aggregated statistics over batches of data. Next I want to combine results of these 4 streams into one stream (Y) and perform some additional computation on received 4 summaries.</p>
  
  <p><a href="https://i.stack.imgur.com/VqbBl.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VqbBl.jpg" alt="enter image description here"></a></p>
  
  <p>The problem is how to make <strong>Y</strong> node wait until it received all the summaries with X=N before going forward with X=N+1.
  In the picture node <strong>3</strong> sent its summary X=N later than node <strong>4</strong> sent its X=N+1
  so node <strong>Y</strong> must wait until it has received node <strong>3</strong> summary while caching summaries with X=N+1 from other nodes somehow.</p>
  
  <p>I couldn't find anything similar in documentation so I'd really appreciate any hints.</p>