默认间隔是200ms
(1) 在 StreamExecutionEnvironmennt
的方法有体现
@PublicEvolving
public void setStreamTimeCharacteristic(TimeCharacteristic characteristic) {
this.timeCharacteristic = Preconditions.checkNotNull(characteristic);
if (characteristic == TimeCharacteristic.ProcessingTime) {
getConfig().setAutoWatermarkInterval(0);
} else {
getConfig().setAutoWatermarkInterval(200);
}
}
如果要修改这个WatermarkInterval时间:
(2)org.apache.flink.api.common.ExecutionConfig:
private long autoWatermarkInterval = 200;
// 可以通过这个方法来修改默认的WatermarkInterval
/**
* Sets the interval of the automatic watermark emission. Watermarks are used throughout
* the streaming system to keep track of the progress of time. They are used, for example,
* for time based windowing.
*
* <p>Setting an interval of {@code 0} will disable periodic watermark emission.
*
* @param interval The interval between watermarks in milliseconds.
*/
@PublicEvolving
public ExecutionConfig setAutoWatermarkInterval(long interval) {
Preconditions.checkArgument(interval >= 0, "Auto watermark interval must not be negative.");
this.autoWatermarkInterval = interval;
return this;
}