T - Value type for window statistics.public abstract class SlidingWindow<T> extends Object
A window contains paneCount panes,
intervalInMs = paneCount * paneIntervalInMs
| 限定符和类型 | 方法和说明 |
|---|---|
Pane<T> |
currentPane()
Get the pane at the current timestamp.
|
Pane<T> |
currentPane(long timeMillis)
Get the pane at the specified timestamp in milliseconds.
|
long |
getIntervalInMs()
Get total interval of the sliding window in milliseconds.
|
long |
getPaneIntervalInMs()
Get pane interval of the sliding window in milliseconds.
|
T |
getPaneValue(long timeMillis)
Get statistic value from pane at the specified timestamp.
|
boolean |
isPaneDeprecated(long timeMillis,
Pane<T> pane)
Checks if the specified pane is deprecated at the specified timestamp.
|
boolean |
isPaneDeprecated(Pane<T> pane)
Checks if the specified pane is deprecated at the current timestamp.
|
List<Pane<T>> |
list()
Get valid pane list for entire sliding window at the current time.
|
List<Pane<T>> |
list(long timeMillis)
Get valid pane list for entire sliding window at the specified time.
|
abstract T |
newEmptyValue(long timeMillis)
Create a new statistic value for pane.
|
List<T> |
values()
Get aggregated value list for entire sliding window at the current time.
|
List<T> |
values(long timeMillis)
Get aggregated value list for entire sliding window at the specified time.
|
public Pane<T> currentPane()
public Pane<T> currentPane(long timeMillis)
timeMillis - a timestamp in milliseconds.public T getPaneValue(long timeMillis)
timeMillis - the specified timestamp in milliseconds.public abstract T newEmptyValue(long timeMillis)
timeMillis - the specified timestamp in milliseconds.public boolean isPaneDeprecated(Pane<T> pane)
pane - the specified pane.public boolean isPaneDeprecated(long timeMillis,
Pane<T> pane)
timeMillis - the specified time.pane - the specified pane.public List<Pane<T>> list()
public List<Pane<T>> list(long timeMillis)
timeMillis - the specified time.public List<T> values()
public List<T> values(long timeMillis)
public long getIntervalInMs()
public long getPaneIntervalInMs()
Copyright © 2011–2020 The Apache Software Foundation. All rights reserved.