liveBook · Manning

Event window

As explained in Event Processing in Action

An event window is a set of events selected from a stream for processing, potentially overlapping with other such sets.

An event window is a subset of events selected from a stream for processing. A window lets a stateful event processing agent work with recent or otherwise relevant events rather than every event it has received. For example, an agent can calculate a rolling average over the last ten sales to help spot emerging trends. section 2.2.3

A continuous stream can be unbounded, so a continuous query operates on bounded subsets instead of the entire stream. It can process a succession of windows, each containing the events selected for that operation. section 10.1.1

In a temporal context, each window corresponds to an interval with a start and an end. Windows can overlap, meet, or have gaps between them. An event can belong to more than one overlapping window, and a window can include events from multiple input streams. Each context partition is handled by a separate agent instance, with no local state carried between instances. section 7.2

An event interval

A patient admittance event can open a window, and a patient release event can close it. The opening and closing events can be specified by event type and, optionally, a predicate. A window can also close after a specified time or when it reaches a specified size, even if no closing event has arrived. section 7.2.2

Some stream-processing languages provide explicit window constructs. In Continuous Computation Language (CCL), a window has a schema and can store records; a KEEP policy specifies the kind of window. Policies can select by time or row count, and some combine a window with grouping by a key. section 7.9

KEEP LAST PER Id
KEEP 3 MINUTES
KEEP EVERY 3 MINUTES
KEEP UNTIL ("MON 17:00:00 ")
KEEP 10 ROWS
KEEP LAST ROW
KEEP 10 ROWS PER Symbol

These CCL KEEP policies illustrate time-based, row-count, and per-key window choices. section 7.9

How Event Processing in Action covers it

How deep it goes
Defines window membership and event-interval boundaries, then illustrates language constructs without exhaustively specifying their semantics.
Examples
Illustrates rolling sales averages, patient admittance and release intervals, and CCL KEEP policies.
What you can do after
Evaluate and understand window selection, overlap, and event-driven boundaries when designing stream processing.
How it connects
Connects windows to temporal context, stateful processing, continuous queries, and segmentation context.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Event Processing in Action. The section links point to the parts of the book it draws on.