第34课: Stage划分和Task最佳位置算法源码彻底解密
Spark作业调度的时候,Job提交过程中Stage 划分的算法以及Task最佳位置的算法。Stage的划分是DAGScheduler工作的核心,涉及作业在集群中怎么运行,Task最佳位置数据本地性的内容。Spark 算子的构建是链式的,涉及到怎么进行计算,首先是划分Stage,Stage划分以后才是计算的本身;分布式大数据系统追求最大化的数据本地性,数据本地性是指数据进行计算的时候,数据就在内存中,甚至不用计算就直接获得结果。
Spark Application中可以因为不同的Action触发众多的Job,也就是说一个Application中可以有很多的Job,每个Job是由一个或者多个Stage构成的,后面的Stage依赖于前面的Stage,也就是说只有前面依赖的Stage计算完毕后,后面的Stage才会运行;
Stage划分就是根据宽依赖,什么时候产生宽依赖呢?例如reducByKey、groupByKey等等;
我们从RDD的collect()方法开始,collect算子是一个Action,会触发job的运行:
RDD.scala的collect方法源码,调用了runJob方法:
1. def collect(): Array[T] = withScope {
2. val results = sc.runJob(this, (iter:Iterator[T]) => iter.toArray)
3. Array.concat(results: _*)
- 计算机视觉系列 -MMDetection 之MobileNetV2YOLOV3 经典算法(一)
- Rasa 3.x 学习系列- Rasa - Issues 4635:Make Rasa X model pull interval configurable in local mode
- Rasa 3.x 学习系列- Rasa - Issues 4759:Training Luis data with luis_schema_version higher than 4.x.x will
- Rasa 3.x 学习系列- Rasa - Issues 4799 rasa interactive does not work without nlu data
- Rasa 3.x 学习系列- Rasa - Issues 4917 Support S3 namespaces when retrieving models from buckets
- Rasa 3.x 学习系列- Rasa - Issues 4925 “rasa init” will ask if user wants to train a model
- Rasa 3.x 学习系列- Rasa - Issues 4985 Fix errors during training in ResponseSelector学习笔记
- Rasa 3.x 学习系列- Rasa - Issues 4933 Improved error message that appears when an incorrect paramete学习笔记
- Rasa 3.x 学习系列- Rasa - Issues 4792 socket debug logs clog up debug feed学习笔记
- Rasa 3.x 学习系列- Rasa - Issues 4873 dispatcher.utter_message 学习笔记