Package org.apache.kafka.streams.kstream
Class UnlimitedWindows
- java.lang.Object
-
- org.apache.kafka.streams.kstream.Windows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
-
- org.apache.kafka.streams.kstream.UnlimitedWindows
-
public final class UnlimitedWindows extends Windows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
The unlimited window specifications used for aggregations.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.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)inthashCode()longmaintainMs()Return the window maintain duration (retention time) in milliseconds.static UnlimitedWindowsof()Return an unlimited window starting at timestamp zero.longsize()Return the size of the specified windows in milliseconds.UnlimitedWindowsstartOn(long startMs)Return a new unlimited window for the specified start timestamp.UnlimitedWindowsuntil(long durationMs)Throws anIllegalArgumentExceptionbecause the retention time for unlimited windows is always infinite and cannot be changed.java.util.Map<java.lang.Long,org.apache.kafka.streams.kstream.internals.UnlimitedWindow>windowsFor(long timestamp)Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.
-
-
-
Method Detail
-
of
public static UnlimitedWindows of()
Return an unlimited window starting at timestamp zero.
-
startOn
public UnlimitedWindows startOn(long startMs) throws java.lang.IllegalArgumentException
Return a new unlimited window for the specified start timestamp.- Parameters:
startMs- the window start time- Returns:
- a new unlimited window that starts at
startMs - Throws:
java.lang.IllegalArgumentException- if the start time is negative
-
windowsFor
public java.util.Map<java.lang.Long,org.apache.kafka.streams.kstream.internals.UnlimitedWindow> windowsFor(long timestamp)
Description copied from class:WindowsCreate all windows that contain the provided timestamp, indexed by non-negative window start timestamps.- Specified by:
windowsForin classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>- Parameters:
timestamp- the timestamp window should get created for- Returns:
- a map of
windowStartTimestamp -> Windowentries
-
size
public long size()
Return the size of the specified windows in milliseconds. As unlimited windows have conceptually infinite size, this methods just returnsLong.MAX_VALUE.
-
until
public UnlimitedWindows until(long durationMs)
Throws anIllegalArgumentExceptionbecause the retention time for unlimited windows is always infinite and cannot be changed.
-
maintainMs
public long maintainMs()
Return the window maintain duration (retention time) in milliseconds. The retention time for unlimited windows in infinite and thus represented asLong.MAX_VALUE.- Overrides:
maintainMsin classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>- Returns:
- the window retention time that is
Long.MAX_VALUE
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-