Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-20190

A New Window Trigger that can trigger window operation both by event time interval、event count for DataStream API

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.13.0
    • Component/s: API / DataStream
    • Labels:
      None

      Description

      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:

      
      private CountAndContinuousEventTimeTrigger(Time interval, long maxCount);
      • 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. 

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              garyelephant GaryGao
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: