spark的checkpoint
来源:互联网 发布:网络终端机 改造 编辑:程序博客网 时间:2024/05/18 00:35
/**
* Mark this RDD for checkpointing. It will be saved to a file inside the checkpoint
* directory set with `SparkContext#setCheckpointDir` and all references to its parent
* RDDs will be removed. This function must be called before any job has been
* executed on this RDD. It is strongly recommended that this RDD is persisted in
* memory, otherwise saving it on a file will require recomputation.
* Mark this RDD for checkpointing. It will be saved to a file inside the checkpoint
* directory set with `SparkContext#setCheckpointDir` and all references to its parent
* RDDs will be removed. This function must be called before any job has been
* executed on this RDD. It is strongly recommended that this RDD is persisted in
* memory, otherwise saving it on a file will require recomputation.
*/
这是源码中RDD里的checkpoint()方法的注释,里面建议在执行checkpoint()方法之前先对rdd进行persisted操作。
为啥要这样呢?因为checkpoint会触发一个Job,如果执行checkpoint的rdd是由其他rdd经过许多计算转换过来的,如果你没有persisted这个rdd,那么又要重头开始计算该rdd,也就是做了重复的计算工作了,所以建议先persist rdd然后再checkpoint,checkpoint会丢弃该rdd的以前的依赖关系,使该rdd成为顶层父rdd,这样在失败的时候恢复只需要恢复该rdd,而不需要重新计算该rdd了,这在迭代计算中是很有用的,假设你在迭代1000次的计算中在第999次失败了,然后你没有checkpoint,你只能重新开始恢复了,如果恰好你在第998次迭代的时候你做了一个checkpoint,那么你只需要恢复第998次产生的rdd,然后再执行2次迭代完成总共1000的迭代,这样效率就很高,比较适用于迭代计算非常复杂的情况,也就是恢复计算代价非常高的情况,适当进行checkpoint会有很大的好处。
0 0
- spark的checkpoint
- spark的checkpoint
- Spark-Streaming checkpoint的原理
- spark checkpoint
- spark rdd checkpoint的用法注意点
- Spark的cache与checkpoint优化
- spark rdd checkpoint的用法注意点
- Spark-Streaming KafkaDirectDStream checkpoint的原理
- D31 Spark的checkpoint/sql/dataframe
- Spark性能调优:checkPoint的使用
- spark基础之spark streaming的checkpoint机制
- spark cache和checkpoint
- Spark函数讲解:checkpoint
- Spark中CheckPoint操作
- Spark cache和checkpoint
- [spark] Checkpoint 源码解析
- spark checkpoint机制简述
- Spark Streaming 之 Checkpoint
- Bitmap too large to be uploaded into a texture 解决方法
- ajax总结
- Unity说明文档翻译-Importing from the Asset Store
- Java基础-接口,内部类及对象克隆的学习
- 一个MFC制作的跑酷游戏的小Demo
- spark的checkpoint
- Linux基础——chown&chgrp 更改用户及属组
- 1093.Count PAT's (25)...to be continued...
- 如何生成JKS文件
- 零输入响应和零状态响应
- c# 获取本地Ip地址
- 6.15、同环比、累加、累加平均、滚动累加、滚动平均
- 后台开发技术基础之无锁队列
- oracle 查看用户所在的表空间