flink的savepoint触发过程涉及到的类是如何协调工作的
时间: 2024-03-31 18:34:47 浏览: 231
flink的savepoint触发过程涉及到的类,是通过协调工作来实现savepoint操作的。具体来说,这些类的协调工作如下:
1. SavepointCoordinator会根据SavepointTrigger的配置触发savepoint操作,并生成一个SavepointMetaData对象,表示新的savepoint开始。
2. SavepointCoordinator会向所有任务发送SavepointBarrier信号,通知它们在栅栏处同步,并等待所有任务的响应。
3. 当任务收到SavepointBarrier信号时,它会先将当前状态写入SavepointStreamFactory创建的流中,然后向SavepointCoordinator发送确认消息。
4. 当SavepointCoordinator收到所有任务的确认消息后,它会将SavepointMetaData和SavepointStreamFactory创建的流交给SavepointStorage进行持久化存储。
5. 如果SavepointStorage成功存储了savepoint数据,SavepointCoordinator会将新的savepoint状态更新,并通知所有任务继续执行。
6. 如果在savepoint过程中出现错误,SavepointCoordinator会尝试进行重试,如果重试失败,则将应用程序标记为失败并停止执行。
7. 当应用程序重新启动时,用户可以根据SavepointMetaData中的信息将应用程序状态恢复到指定的savepoint状态。
8. 当应用程序停止时,SavepointCommitter会清理过期的savepoint数据,以释放存储空间。
总之,flink的savepoint操作涉及到的类通过协调工作,实现了数据的快照和持久化存储,以及任务的同步和恢复。这个过程是自动完成的,用户只需要根据SavepointMetaData中的信息恢复应用程序状态即可。
阅读全文
相关推荐
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![-](https://img-home.csdnimg.cn/images/20241226111658.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)