Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 2.13 KB

kafka-streams-Windows.adoc

File metadata and controls

74 lines (53 loc) · 2.13 KB

Windows — Window Specification For Time-Windowed Streaming Aggregations

Windows is the abstraction of window specifications that describe windows of fixed size and grace period.

Windows are used in KGroupedStream.windowedBy streaming operator (for time-windowed streaming aggregations).

Table 1. Windows API / Operators
Method Description

gracePeriodMs

long gracePeriodMs()

Grace period (in milliseconds)

New events are added to windows until their grace period ends

size

long size()

Window size (in milliseconds)

windowsFor

Map<Long, W> windowsFor(final long timestamp)

Returns all the windows that contain the given timestamp, indexed by non-negative window start timestamps.

Used when KStreamWindowAggregateProcessor is requested to process a record

Table 2. Windows
Windows Description

JoinWindows

TimeWindows

Time-bound window specification for tumbling or hopping windows

UnlimitedWindows

Windows takes no arguments when created and simply initializes the internal registries and counters.

Note
Windows is a Java abstract class and cannot be created directly. It is created indirectly when the concrete Windows are.

Windows defines a window maintain duration (aka retention time). The default window maintain duration is 1 day.