switch event time to process time

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

switch event time to process time

venn wu

Dear experts:

            My  flink job work with event time, but I  have a trouble, the source even will be very few at the early morning, can't finish current widow and emitted the result as expect.  I found the next paragraph at official website. How can I “switches to using current processing time as the time basis after not observing new events for a while” ?

 

https://ci.apache.org/projects/flink/flink-docs-release-1.9/dev/event_time.html#idling-sources

 “

Currently, with pure event time watermarks generators, watermarks can not progress if there are no elements to be processed. That means in case of gap in the incoming data, event time will not progress and for example the window operator will not be triggered and thus existing windows will not be able to produce any output data.

To circumvent this one can use periodic watermark assigners that don’t only assign based on element timestamps. An example solution could be an assigner that switches to using current processing time as the time basis after not observing new events for a while.

Sources can be marked as idle using SourceFunction.SourceContext#markAsTemporarilyIdle. For details please refer to the Javadoc of this method as well as StreamStatus.


Thanks