Constructor and Description |
---|
TimeWindowUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
getNextTriggerWatermark(long currentWatermark,
long interval,
java.time.ZoneId shiftTimezone,
boolean useDayLightSaving)
Method to get the next watermark to trigger window.
|
static java.time.ZoneId |
getShiftTimeZone(LogicalType timeAttributeType,
TableConfig tableConfig)
Get the shifted timezone of window if the time attribute type is TIMESTAMP_LTZ, always
returns UTC timezone if the time attribute type is TIMESTAMP which means do not shift.
|
static boolean |
isWindowFired(long windowEnd,
long currentProgress,
java.time.ZoneId shiftTimeZone)
Returns the window should fired or not on current progress.
|
static long |
toEpochMills(long utcTimestampMills,
java.time.ZoneId shiftTimeZone)
Convert a timestamp mills with the given timezone to epoch mills.
|
static long |
toEpochMillsForTimer(long utcTimestampMills,
java.time.ZoneId shiftTimeZone)
Get a timer time according to the timestamp mills and the given shift timezone.
|
static long |
toUtcTimestampMills(long epochMills,
java.time.ZoneId shiftTimeZone)
Convert a epoch mills to timestamp mills which can describe a locate date time.
|
public static long toUtcTimestampMills(long epochMills, java.time.ZoneId shiftTimeZone)
For example: The timestamp string of epoch mills 5 in GMT+08:00 is 1970-01-01 08:00:05, the timestamp mills is 8 * 60 * 60 * 1000 + 5.
epochMills
- the epoch mills.shiftTimeZone
- the timezone that the given timestamp mills has been shifted.public static long toEpochMillsForTimer(long utcTimestampMills, java.time.ZoneId shiftTimeZone)
utcTimestampMills
- the timestamp mills.shiftTimeZone
- the timezone that the given timestamp mills has been shifted.public static long toEpochMills(long utcTimestampMills, java.time.ZoneId shiftTimeZone)
utcTimestampMills
- the timezone that the given timestamp mills has been shifted.shiftTimeZone
- the timezone that the given timestamp mills has been shifted.public static java.time.ZoneId getShiftTimeZone(LogicalType timeAttributeType, TableConfig tableConfig)
public static boolean isWindowFired(long windowEnd, long currentProgress, java.time.ZoneId shiftTimeZone)
windowEnd
- the end of the time window.currentProgress
- current progress of the window operator, it is processing time under
proctime, it is watermark value under rowtime.shiftTimeZone
- the shifted timezone of the time window.public static long getNextTriggerWatermark(long currentWatermark, long interval, java.time.ZoneId shiftTimezone, boolean useDayLightSaving)
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.