public class TimeWindow extends Window
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TimeWindow.Serializer
The serializer used to write the TimeWindow type.
|
| 构造器和说明 |
|---|
TimeWindow(long start,
long end) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(Window o) |
TimeWindow |
cover(TimeWindow other)
Returns the minimal window covers both this window and the given window.
|
boolean |
equals(Object o) |
long |
getEnd()
Gets the end timestamp of this window.
|
long |
getStart()
Gets the starting timestamp of the window.
|
static long |
getWindowStartWithOffset(long timestamp,
long offset,
long windowSize)
Method to get the window start for a timestamp.
|
int |
hashCode() |
boolean |
intersects(TimeWindow other)
Returns
true if this window intersects the given window. |
long |
maxTimestamp()
Gets the largest timestamp that still belongs to this window.
|
static TimeWindow |
of(long start,
long end) |
String |
toString() |
public long getStart()
public long getEnd()
public long maxTimestamp()
This timestamp is identical to getEnd() - 1.
maxTimestamp 在类中 WindowgetEnd()public boolean intersects(TimeWindow other)
true if this window intersects the given window.public TimeWindow cover(TimeWindow other)
public int compareTo(Window o)
public static long getWindowStartWithOffset(long timestamp,
long offset,
long windowSize)
timestamp - epoch millisecond to get the window start.offset - The offset which window start would be shifted by.windowSize - The size of the generated windows.public static TimeWindow of(long start, long end)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.