IBM Streams 4.3.0

Developing stream processing applications with event time

Event time is a simple model which supports streams processing where time is not derived from the system time of the machine IBM® Streams is running on, but from a time value associated with each tuple. In a graph enabled for event time, tuples have an attribute which holds their time value. The time value for each tuple enables operations such as grouping tuples with a time value falling within specified time intervals, and running aggregate calculations on the group.

TimeInterval windows collect tuples into fixed-duration intervals defined over the event time. A timeInterval window assigns tuples to the window panes corresponding to the time intervals to which the tuples belong. A tuple can be inserted into one or more window panes.

A timeInterval window pane triggers when the operator's watermark is larger than or equal to the end of the interval. A pane triggers again when tuples are inserted which arrive after the watermark passed its end. When a pane triggers, the event handler calculates aggregate values based on the pane content.
Note: TimeInterval windows can be partitioned, similar to tumbling and sliding windows. When a pane triggers, a trigger event is produced for each partition.
The following examples show how timeInterval windows can improve the analysis of your streams processing applications:
  • If a tuple represents a certain event, the event time is the instant when the event actually occurred, not when its tuple is processed by your application.
  • You can include windowed operations, such as aggregates, for time intervals based on event time. For example, calculate the number of cars which passed through an intersection every hour starting at 12 AM, even though data arrives at your Streams application later and possibly out of order.
  • Your application can recalculate aggregates if it receives events pertaining to a given time interval after the aggregates for that interval have been calculated.
  • You can configure how the current event time for a stream is calculated to avoid having a large number of late tuples that arrive after the set date.