Developing stream 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 Teracloud® 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.
- 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.