flink的checkpoint的容错机制的相关配置代码
//checkpoint的间隔时间
env.enableCheckpointing(5000)
//事件只处理一次
env.getCheckpointConfig.setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE)
//checkpoint的最小时间
env.getCheckpointConfig.setMinPauseBetweenCheckpoints(1000)
//checkpoint的超时时间
env.getCheckpointConfig.setCheckpointTimeout(60000)
//checkpoint的最大并行度
env.getCheckpointConfig.setMaxConcurrentCheckpoints(1)
//程序关闭的时候checkpoint
env.getCheckpointConfig.enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION)
env.setStateBackend(new FsStateBackend("hdfs://hadoop01:9000/flink-checkpoint"))