RestartStrategyConfigurations
无重启 (No restart)
固定间隔延迟重启 (Fixed delay)
失败率 (Failure rate)
备选 (Fallback )
Fallback 后备重启策略,即所谓的默认重启策略;Cluster level default restart strategy
集群中如果没有在配置文件(flink-conf.yaml)中显示的配置重启策略,
也没有在编程中配置重启策略,在检查点机制开启的情况下
-- NoOrFixedIfCheckpointingEnabledRestartStrategyFactory
Default restart strategy that resolves
either to {@link NoRestartStrategy} or {@link FixedDelayRestartStrategy}
depending if checkpointing was enabled.
如果没有启用 checkpointing,则使用无重启 (no restart) 策略。
如果启用了 checkpointing,但没有配置重启策略,则使用固定间隔 (fixed-delay) 策略,其中 Integer.MAX_VALUE 参数是尝试重启次数
重启的源码:
RestartStrategyConfiguration是个抽象类,它定义了getDescription抽象方法,
它有NoRestartStrategyConfiguration、
FallbackRestartStrategyConfiguration
FixedDelayRestartStrategyConfiguration、
FailureRateRestartStrategyConfiguration、
具体示例:
NoRestartStrategyConfiguration extends RestartStrategyConfiguration
00. RestartStrategyConfiguration // Abstract configuration for restart strategies.
01.
02.FallbackRestartStrategyConfiguration
Cluster level default restart strategy
使用案例:
env.setRestartStrategy(RestartStrategies.fixedDelayRestart(3, Time.of(10L, TimeUnit.SECONDS)));
//NANOSECONDS 纳秒,符号ns(英语: nanoseconds )
// Time unit representing one thousandth of a millisecond MICROSECONDS
// Time unit representing one thousandth of a second MILLISECONDS 微秒,符号μs microsecond
// SECONDS MINUTES HOURS DAYS