@PublicEvolving public enum TimeCharacteristic extends Enum<TimeCharacteristic>
枚举常量和说明 |
---|
EventTime
Event time means that the time of each individual element in the stream (also called event)
is determined by the event's individual custom timestamp.
|
IngestionTime
Ingestion time means that the time of each individual element in the stream is determined
when the element enters the Flink streaming data flow.
|
ProcessingTime
Processing time for operators means that the operator uses the system clock of the machine
to determine the current time of the data stream.
|
public static final TimeCharacteristic ProcessingTime
Using processing time for window operations results in general in quite non-deterministic results, because the contents of the windows depends on the speed in which elements arrive. It is, however, the cheapest method of forming windows and the method that introduces the least latency.
public static final TimeCharacteristic IngestionTime
Ingestion time is often a good compromise between processing time and event time. It does not need any special manual form of watermark generation, and events are typically not too much out-or-order when they arrive at operators; in fact, out-of-orderness can only be introduced by streaming shuffles or split/join/union operations. The fact that elements are not very much out-of-order means that the latency increase is moderate, compared to event time.
public static final TimeCharacteristic EventTime
Operators that window or order data with respect to event time must buffer data until they can be sure that all timestamps for a certain time interval have been received. This is handled by the so called "time watermarks".
Operations based on event time are very predictable - the result of windowing operations is typically identical no matter when the window is executed and how fast the streams operate. At the same time, the buffering and tracking of event time is also costlier than operating with processing time, and typically also introduces more latency. The amount of extra cost depends mostly on how much out of order the elements arrive, i.e., how long the time span between the arrival of early and late elements is. With respect to the "time watermarks", this means that the cost typically depends on how early or late the watermarks can be generated for their timestamp.
In relation to IngestionTime
, the event time is similar, but refers the the
event's original time, rather than the time assigned at the data source. Practically, that
means that event time has generally more meaning, but also that it takes longer to determine
that all elements for a certain time have arrived.
public static TimeCharacteristic[] values()
for (TimeCharacteristic c : TimeCharacteristic.values()) System.out.println(c);
public static TimeCharacteristic valueOf(String name)
name
- 要返回的枚举常量的名称。IllegalArgumentException
- 如果该枚举类型没有带有指定名称的常量NullPointerException
- 如果参数为空值Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.