Update Spark-RDD.md

This commit is contained in:
heibaiying 2019-05-16 15:15:30 +08:00 committed by GitHub
parent d755797b43
commit 50ffdd50cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ Spark会自动监视每个节点上的缓存使用情况并按照最近最少
Spark中一个任务对应一个分区通常不会跨分区操作数据。但如果遇到reduceByKey等操作Spark必须从所有分区读取数据并查找所有键的所有值然后汇总在一起以计算每个键的最终结果 这称为shuffle。
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-reducebykey.png"/> </div>
<div align="center"> <img width="600px" src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-reducebykey.png"/> </div>
@ -206,7 +206,7 @@ RDD和它的父RDD(s)之间的依赖关系分为两种不同的类型:
如下图:每一个方框表示一个 RDD带有颜色的矩形表示分区
<div align="center"> <img src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-窄依赖和宽依赖.png"/> </div>
<div align="center"> <img width="600px" src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-窄依赖和宽依赖.png"/> </div>
@ -226,7 +226,7 @@ RDD(s)及其之间的依赖关系组成了DAG(有向无环图)DAG定义了这
+ 对于窄依赖,由于分区的依赖关系是确定的,其转换操作可以在同一个线程执行,所以可以划分到同一个执行阶段;
+ 对于宽依赖由于Shuffle的存在只能在父RDD(s)被Shuffle处理完成后才能开始接下来的计算因此遇到宽依赖就需要重新划分阶段。
<div align="center"> <img width="600px" src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-DAG.png"/> </div>
<div align="center"> <img width="600px" height="600px" src="https://github.com/heibaiying/BigData-Notes/blob/master/pictures/spark-DAG.png"/> </div>