Class Time
- java.lang.Object
-
- org.apache.flink.streaming.api.windowing.time.Time
-
@Public public final class Time extends Object
The definition of a time interval for windowing. The time characteristic referred to is the default time characteristic set on the execution environment.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Timedays(long days)Creates a newTimethat represents the given number of days.longgetSize()Gets the length of this policy's time interval.TimeUnitgetUnit()Gets the time unit for this policy's time interval.static Timehours(long hours)Creates a newTimethat represents the given number of hours.static Timemilliseconds(long milliseconds)Creates a newTimethat represents the given number of milliseconds.static Timeminutes(long minutes)Creates a newTimethat represents the given number of minutes.static Timeof(long size, TimeUnit unit)static Timeseconds(long seconds)Creates a newTimethat represents the given number of seconds.longtoMilliseconds()Converts the time interval to milliseconds.
-
-
-
Method Detail
-
getUnit
public TimeUnit getUnit()
Gets the time unit for this policy's time interval.- Returns:
- The time unit for this policy's time interval.
-
getSize
public long getSize()
Gets the length of this policy's time interval.- Returns:
- The length of this policy's time interval.
-
toMilliseconds
public long toMilliseconds()
Converts the time interval to milliseconds.- Returns:
- The time interval in milliseconds.
-
of
public static Time of(long size, TimeUnit unit)
Creates a newTimeof the given duration andTimeUnit.The
Timerefers to the time characteristic that is set on the dataflow viaStreamExecutionEnvironment.setStreamTimeCharacteristic(org.apache.flink.streaming.api.TimeCharacteristic).- Parameters:
size- The duration of time.unit- The unit of time of the duration, for exampleTimeUnit.SECONDS.- Returns:
- The time policy.
-
milliseconds
public static Time milliseconds(long milliseconds)
Creates a newTimethat represents the given number of milliseconds.
-
seconds
public static Time seconds(long seconds)
Creates a newTimethat represents the given number of seconds.
-
minutes
public static Time minutes(long minutes)
Creates a newTimethat represents the given number of minutes.
-
hours
public static Time hours(long hours)
Creates a newTimethat represents the given number of hours.
-
-