@InterfaceStability.Unstable public class TimeWindow extends Window
TimeWindow
covers a half-open time interval with its start timestamp as an inclusive boundary and its end
timestamp as exclusive boundary.
It is a fixed size window, i.e., all instances (of a single window specification
) will have the same size.
For time semantics, see TimestampExtractor
.
SessionWindow
,
UnlimitedWindow
,
TimeWindows
,
TimestampExtractor
Constructor and Description |
---|
TimeWindow(long startMs,
long endMs)
Create a new window for the given start time (inclusive) and end time (exclusive).
|
Modifier and Type | Method and Description |
---|---|
boolean |
overlap(Window other)
Check if the given window overlaps with this window.
|
public TimeWindow(long startMs, long endMs) throws java.lang.IllegalArgumentException
startMs
- the start timestamp of the window (inclusive)endMs
- the end timestamp of the window (exclusive)java.lang.IllegalArgumentException
- if startMs
is negative or if endMs
is smaller than or equal to
startMs
public boolean overlap(Window other) throws java.lang.IllegalArgumentException