Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread Tomasz Dobrzycki
Hi Tony, Thank you for this thorough explanation. Helps a lot! Kind Regards, Tomasz On 23 August 2017 at 11:30, Tony Wei wrote: > Hi Tomasz, > > Actually, window is not a real operator shared by your operators created by > reduce() and apply() function. > Flink implemented WindowOperator by bin

Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread Tony Wei
Hi Tomasz, Actually, window is not a real operator shared by your operators created by reduce() and apply() function. Flink implemented WindowOperator by binding window(), trigger() and evictor() as well with the WindowFunction. It is more like the prior operator sent elements to two following ope

Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread Tomasz Dobrzycki
Hi Tony, Won't that increase the amount of processing Flink has to do? It would have to window twice, right? Thanks, Tomasz On 23 August 2017 at 11:02, Tony Wei wrote: > Hi Tomasz, > > In my opinion, I would move .window() function down to these two DataStream. > (rawEvent.window().reduce().map

Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread Tony Wei
Hi Tomasz, In my opinion, I would move .window() function down to these two DataStream. (rawEvent.window().reduce().map(), and so does metrics) It makes sure that they won't share the same constructor. Regards, Tony Wei 2017-08-23 17:51 GMT+08:00 Tomasz Dobrzycki : > Hi Tony, > > Thank you for

Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread Tomasz Dobrzycki
Hi Tony, Thank you for your answer, it definitely helps with understanding this situation. Is there any reliable way to split the stream so I get 2 outputs that avoids this behaviour? Eventually I want to have 2 sinks that output different data (one being just a copy of the stream, but organised i

Re: Unexpected behaviour of a periodic trigger.

2017-08-23 Thread 魏偉哲
Hi Tomasz, I think this is because .window() is a lazy operator. It just creates a WindowedStream class but not create a corresponding operator. The operator will be created after you called .reduce() and .apply(). rawEvents and metrics actually shared the same object to create their own operator