Hi Soheil,

Did you read the documentation about Flink Window/Trigger [1]?

FIRE_AND_PURGE usually used to implement the count window. Flink provide a
PurgingTrigger as a warper for other trigger to make those triggers can be
purge. One of this class use case is count window[2][3].

About your example, you mean the window will triggered by count and time?
if it is triggered by count condition we could use FIRE_AND_PURGE.

[1]:
https://ci.apache.org/projects/flink/flink-docs-release-1.5/dev/stream/operators/windows.html#fire-and-purge
[2]:
https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L765
[3]:
https://github.com/apache/flink/blob/master/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/KeyedStream.java#L628

Thanks, vino.

2018-07-17 22:44 GMT+08:00 Soheil Pourbafrani <soheil.i...@gmail.com>:

> 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