Lifecycle of a timeInterval window pane
This topic describes the lifecycle of a timeInterval window pane.
A timeInterval window is:
- Created
- When the first tuples are assigned to it.
- Closed
- When the current watermark is beyond the discard age. The discard age is defined as the end of the interval plus the tuple age beyond which tuples are ignored. In this case the window pane ignores further input and its contents are discarded.
- Incomplete
- If the current watermark has not yet reached the end of the pane interval.
- Complete
- If the current watermark is greater than or equal to the end of the pane interval.
When the current event time (specified by the watermark) becomes greater than or equal to the interval's end, the window pane is completed and triggers. If tuples with event times within the pane’s interval arrive after the pane has triggered (late tuples), the pane triggers again and the operator which handles the trigger event re-calculates output taking into account the late data.
A timeInterval window pane triggers when:
- The latest watermark is larger than or equal to the interval end.
- Late events are inserted, which arrive after the watermark passed its end.
As a result the event handler then calculates aggregate values based on the window content.
Example of a timeInterval window lifecycle
A timeInterval window can be configured to create non-overlapping window panes every hour with a
discard age of 6 hours:
- A new pane is created for the interval [00:00 … 01:00) when the first tuple with an event time, which falls into this interval, arrives.
- It marks the window complete when the input watermark passes 01:00.
- It closes (and removes) this window when the watermark passes 07:00.