Hi Soheil,

The clear() method performs any action needed upon removal of the
corresponding window. This is called when a window is purged. The
differences between FIRE and FIRE_AND_PURGE is FIRE only trigger the
computation while FIRE_AND_PURGE trigger the computation and clear the
elements in the window afterwards.

As for your example, if you use FIRE, when the new data comes, the window
is triggered for all data. Besides, some window functions can incrementally
aggregate the elements for each window as they arrive, for example
AggregateFunction and FoldFunction.

More details can be found here[1].

Best, Hequn

[1]
https://ci.apache.org/projects/flink/flink-docs-master/dev/stream/operators/windows.html#windows



On Tue, Jul 17, 2018 at 10:44 PM, Soheil Pourbafrani <soheil.i...@gmail.com>
wrote:

> Hi,
>
> Can someone elaborate on when the clear method on class Trigger will be
> called and what is the duty of that? Also, I don't know what is the benefit
> of FIRE_AND_PURGE against FIRE and it's use case.
>
> For example, in a scenario, if we have a count of 3 Window that also will
> trigger after a timeout if we FIRE window on timeout and after a while, a
> new data will be added to the data, will window be triggered for all data
> or not just for new late data? I guess in such such case we should use the
> FIRE_AND_PURGE.
>
>

Reply via email to