简体   繁体   English

Flink 中的检查点不适用于 CoFlatMapFunction

[英]Checkpointing in Flink is not working with CoFlatMapFunction

Hi i am trying to do checkpointing in one of my flink module in which i am using CoFlatMapFunction to combine to streams if i comment out the CoFlatMapFunction checkpointing is working if uncomment again its not working.嗨,我正在尝试在我的 flink 模块之一中进行检查点,如果我注释掉 CoFlatMapFunction 检查点正在工作,如果再次取消注释它不起作用,我将在其中使用 CoFlatMapFunction 组合到流。 i updated the Checkpointing as this documentation in flink website in which it says for iterative streams there is an extra attribute added to force the checkpoint event after doing that also its not working please find below for the checkpoint settings我将检查点更新为 flink 网站中的此文档,其中说对于迭代流,添加了一个额外的属性来强制检查点事件,这样做后它也不起作用,请在下面找到检查点设置

StateBackend stateBackend = new RocksDBStateBackend(path, true);

//env.enableCheckpointing(interval, CheckpointingMode.EXACTLY_ONCE);

env.enableCheckpointing(interval,CheckpointingMode.EXACTLY_ONCE,true);

 env.getCheckpointConfig().setMinPauseBetweenCheckpoints(1000);

 env.getCheckpointConfig().setCheckpointTimeout(120000);
 
 env.getCheckpointConfig().setMaxConcurrentCheckpoints(2);

 env.getCheckpointConfig().enableExternalizedCheckpoints(CheckpointConfig.ExternalizedCheckpointCleanup.RETAIN_ON_CANCELLATION);
 
 env.getCheckpointConfig().setPreferCheckpointForRecovery(true);

 env.setStateBackend(stateBackend);

I can see on of the task status finished but i am unable to see the logs since我可以看到任务状态已完成,但我无法看到日志,因为

在此处输入图片说明

I believe the reason for this is FLINK-2491 : checkpointing only works if all operators/tasks are still running.我相信这是FLINK-2491的原因:检查点仅在所有操作员/任务仍在运行时才有效。

You should replace the source that is injecting some data from a Collection with some other source that won't just instantly transition to being finished , perhaps a custom source that keeps the source alive once it runs out of data to emit, but doing nothing.您应该将从 Collection 注入一些数据的源替换为其他一些不会立即转换为完成的源,也许是一个自定义源,它可以在源用完要发出的数据时保持活动状态,但什么也不做。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM