Class TimeWindow
- java.lang.Object
-
- org.apache.kafka.streams.kstream.Window
-
- org.apache.kafka.streams.kstream.internals.TimeWindow
-
public class TimeWindow extends Window
ATimeWindowcovers 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 singlewindow specification) will have the same size.For time semantics, see
TimestampExtractor.- See Also:
SessionWindow,UnlimitedWindow,TimeWindows,TimestampExtractor
-
-
Constructor Summary
Constructors Constructor Description TimeWindow(long startMs, long endMs)Create a new window for the given start time (inclusive) and end time (exclusive).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanoverlap(Window other)Check if the given window overlaps with this window.
-
-
-
Constructor Detail
-
TimeWindow
public TimeWindow(long startMs, long endMs) throws java.lang.IllegalArgumentExceptionCreate a new window for the given start time (inclusive) and end time (exclusive).- Parameters:
startMs- the start timestamp of the window (inclusive)endMs- the end timestamp of the window (exclusive)- Throws:
java.lang.IllegalArgumentException- ifstartMsis negative or ifendMsis smaller than or equal tostartMs
-
-
Method Detail
-
overlap
public boolean overlap(Window other) throws java.lang.IllegalArgumentException
Check if the given window overlaps with this window.
-
-