public final class UnlimitedWindows extends Windows<UnlimitedWindow>
An unlimited time window is also called landmark window. It has a fixed starting point while its window end is defined as infinite. With this regard, it is a fixed-size window with infinite window size.
For time semantics, see TimestampExtractor
.
TimeWindows
,
SessionWindows
,
JoinWindows
,
KGroupedStream.count(Windows, String)
,
KGroupedStream.count(Windows, org.apache.kafka.streams.processor.StateStoreSupplier)
,
KGroupedStream.reduce(Reducer, Windows, String)
,
KGroupedStream.reduce(Reducer, Windows, org.apache.kafka.streams.processor.StateStoreSupplier)
,
KGroupedStream.aggregate(Initializer, Aggregator, Windows, org.apache.kafka.common.serialization.Serde, String)
,
KGroupedStream.aggregate(Initializer, Aggregator, Windows, org.apache.kafka.streams.processor.StateStoreSupplier)
,
TimestampExtractor
Modifier and Type | Field and Description |
---|---|
long |
startMs
The start timestamp of the window.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
long |
maintainMs()
Return the window maintain duration (retention time) in milliseconds.
|
static UnlimitedWindows |
of()
Return an unlimited window starting at timestamp zero.
|
long |
size()
Return the size of the specified windows in milliseconds.
|
UnlimitedWindows |
startOn(long startMs)
Return a new unlimited window for the specified start timestamp.
|
UnlimitedWindows |
until(long durationMs)
Throws an
IllegalArgumentException because the retention time for unlimited windows is always infinite
and cannot be changed. |
Map<Long,UnlimitedWindow> |
windowsFor(long timestamp)
Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.
|
public static UnlimitedWindows of()
public UnlimitedWindows startOn(long startMs) throws IllegalArgumentException
startMs
- the window start timestartMs
IllegalArgumentException
- if the start time is negativepublic Map<Long,UnlimitedWindow> windowsFor(long timestamp)
Windows
windowsFor
in class Windows<UnlimitedWindow>
timestamp
- the timestamp window should get created forwindowStartTimestamp -> Window
entriespublic long size()
Long.MAX_VALUE
.size
in class Windows<UnlimitedWindow>
Long.MAX_VALUE
public UnlimitedWindows until(long durationMs)
IllegalArgumentException
because the retention time for unlimited windows is always infinite
and cannot be changed.until
in class Windows<UnlimitedWindow>
durationMs
- the window retention time in millisecondsIllegalArgumentException
- on every invocationpublic long maintainMs()
Long.MAX_VALUE
.maintainMs
in class Windows<UnlimitedWindow>
Long.MAX_VALUE