W
- type of the window instance@InterfaceStability.Unstable public abstract class Windows<W extends Window> extends Object
If not explicitly specified, the default maintain duration is 1 day.
For time semantics, see TimestampExtractor
.
Modifier and Type | Field and Description |
---|---|
int |
segments |
Modifier | Constructor and Description |
---|---|
protected |
Windows() |
Modifier and Type | Method and 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 Map<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 IllegalArgumentException
durationMs
- the window retention time in millisecondsIllegalArgumentException
- if durationMs
is negativepublic long maintainMs()
protected Windows<W> segments(int segments) throws IllegalArgumentException
segments
- the number of segments to be usedIllegalArgumentException
- if specified segments is small than 2public abstract Map<Long,W> windowsFor(long timestamp)
timestamp
- the timestamp window should get created forwindowStartTimestamp -> Window
entriespublic abstract long size()