In production environment, when we are do some window operation, such as window aggregation, using data stream api, developers are always asked to not only trigger the window operation when the watermark pass the max timestamp of window, but also trigger it both by fixed event time interval and fixed count of event.The reason why we want to do this is we are looking forward to get the frequently updated window operation result, other than waiting for a long time until the watermark pass the max timestamp of window.This is very useful in reporting and other BI applications.
For now the default triggers provided by flink can not close this requirement, so I developed a New Trigger, so called CountAndContinuousEventTimeTrigger, combine ContinuousEventTimeTrigger with CountTrigger to do the above thing.
To use CountAndContinuousEventTimeTrigger, you should specify two parameters as revealed in it constructor:
- Time interval, it means this trigger will continuously fires based on a given time interval, the same as ContinuousEventTimeTrigger.
- long maxCount, it means this trigger will fires once the count of elements in a pane reaches the given count, the same as CountTrigger.