W
- type of the window instanceJoinWindows
, TimeWindows
, UnlimitedWindows
public abstract class Windows<W extends Window>
extends java.lang.Object
If not explicitly specified, the default maintain duration is 1 day.
For time semantics, see TimestampExtractor
.
TimeWindows
,
UnlimitedWindows
,
JoinWindows
,
SessionWindows
,
TimestampExtractor
Modifier and Type | Field | Description |
---|---|---|
int |
segments |
Modifier | Constructor | Description |
---|---|---|
protected |
Windows() |
Modifier and Type | Method | Description |
---|---|---|
long |
maintainMs() |
Return the window maintain duration (retention time) in milliseconds.
|
protected Windows<W> |
segments(int segments) |
Set the number of segments to be used for rolling the window store.
|
abstract long |
size() |
Return the size of the specified windows in milliseconds.
|
Windows<W> |
until(long durationMs) |
Set the window maintain duration (retention time) in milliseconds.
|
abstract java.util.Map<java.lang.Long,W> |
windowsFor(long timestamp) |
Create all windows that contain the provided timestamp, indexed by non-negative window start timestamps.
|
public Windows<W> until(long durationMs) throws java.lang.IllegalArgumentException
durationMs
- the window retention time in millisecondsjava.lang.IllegalArgumentException
- if durationMs
is negativepublic long maintainMs()
protected Windows<W> segments(int segments) throws java.lang.IllegalArgumentException
segments
- the number of segments to be usedjava.lang.IllegalArgumentException
- if specified segments is small than 2public abstract java.util.Map<java.lang.Long,W> windowsFor(long timestamp)
timestamp
- the timestamp window should get created forwindowStartTimestamp -> Window
entriespublic abstract long size()