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 Deprecated Methods Modifier and Type Method Description boolean
equals(Object o)
long
gracePeriodMs()
Return the window grace period (the time to admit out-of-order events after the end of the window.) Delay is defined as (stream_time - record_timestamp).int
hashCode()
long
maintainMs()
Deprecated.since 2.1.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)
Deprecated.UsestartOn(Instant)
insteadUnlimitedWindows
startOn(Instant start)
Return a new unlimited window for the specified start timestamp.String
toString()
UnlimitedWindows
until(long durationMs)
Deprecated.since 2.1.Map<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
@Deprecated public UnlimitedWindows startOn(long startMs) throws IllegalArgumentException
Deprecated.UsestartOn(Instant)
insteadReturn 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:
IllegalArgumentException
- if the start time is negative
-
startOn
public UnlimitedWindows startOn(Instant start) throws IllegalArgumentException
Return a new unlimited window for the specified start timestamp.- Parameters:
start
- the window start time- Returns:
- a new unlimited window that starts at
start
- Throws:
IllegalArgumentException
- if the start time is negative or can't be represented aslong milliseconds
-
windowsFor
public Map<Long,org.apache.kafka.streams.kstream.internals.UnlimitedWindow> windowsFor(long timestamp)
Description copied from class:Windows
Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.- Specified by:
windowsFor
in classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
- Parameters:
timestamp
- the timestamp window should get created for- Returns:
- a map of
windowStartTimestamp -> Window
entries
-
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
.- Specified by:
size
in classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
- Returns:
- the size of the specified windows which is
Long.MAX_VALUE
-
until
@Deprecated public UnlimitedWindows until(long durationMs)
Deprecated.since 2.1.Throws anIllegalArgumentException
because the retention time for unlimited windows is always infinite and cannot be changed.- Overrides:
until
in classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
- Parameters:
durationMs
- the window retention time in milliseconds- Returns:
- itself
- Throws:
IllegalArgumentException
- on every invocation.
-
maintainMs
@Deprecated public long maintainMs()
Deprecated.since 2.1. UseMaterialized.retention
instead.Return the window maintain duration (retention time) in milliseconds. The retention time for unlimited windows in infinite and thus represented asLong.MAX_VALUE
.- Overrides:
maintainMs
in classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
- Returns:
- the window retention time that is
Long.MAX_VALUE
-
gracePeriodMs
public long gracePeriodMs()
Description copied from class:Windows
Return the window grace period (the time to admit out-of-order events after the end of the window.) Delay is defined as (stream_time - record_timestamp).- Specified by:
gracePeriodMs
in classWindows<org.apache.kafka.streams.kstream.internals.UnlimitedWindow>
-
-