当前位置:网站首页>spark源码阅读总纲
spark源码阅读总纲
2022-07-01 13:00:00 【Interest1_wyt】
spark使用了这么长时间,对于driver、master、worker、BlockManage、RDD、DAGScheduler、TaskScheduler这些概念或多或少都了解一些,但是对于其任务的提交,driver、application的调度与注册,资源的分配,executor的创建,job到stage再到task的切分过程,hdfs文件数据的读写操作,RDD本身的map reduce操作,持久化、check point的高可靠性容错性的实现等都没有一个系统和深入的了解,所以准备写个系列的文章,从源码角度探查下这些问题,以此加深对于spark的理解。这里只是列出了我目前感兴趣的点,后期如果有其它想研究的源码点,也会陆续加入该总纲和后面的系列文章中。
我虚拟机中安装的是spark3.0.1版本,所以源码我下载的也是这个。另外因为spark源码过多,为了更有效率的阅读,避免出现读懵的情况,所以我先列出了自己感兴趣的问题点,在源码阅读中也主要是以解决这些问题为主线。问题列表如下:
1、spark-submit如何将jar以及配置参数提交给spark服务器
2、spark如何启动driver、application注册、executor构建命令拼装
3、spark 如何进行driver、executor(application)任务的调度,以及executor向driver的注册
4、executor在worker上的创建过程,其本质是什么,是线程池吗?
5、DAGScheduler TaskScheduler如何配合提交任务,application、job、stage、taskset、task对应关系是什么?
6、spark如何通过BlockManager控制数据的读写(待整理)
7、持久化、缓存、checkpoint功能区别和原理(待整理)
源码阅读中会有各种各样的名词术语,这里统一放到总纲中介绍:
Master:spark集群的主节点,管理spark其它节点的资源调度。
Worker:spark集群的工作节点,根据master主节点的管理,其创建并分配一定资源给executor。
Executor:spark最底层的工作线程池,由worker创建和分配资源。其要执行的工作由driver分发。
Driver:用户提交的应用程序代码在spark中运行起来就是一个driver,他是一个特殊的excutor进程,这个进程除了一般excutor都具有的运行环境外,还运行着DAGscheduler Tasksheduler Schedulerbackedn等组件。
Application:用户提交任务执行的总称。
Job:由Action算子触发生成的由一个或者多个stage组成的计算作业
DAGScheduler:根据job构建基于stage的DAG,其切分stage的依据是是否有shuffle操作发生。该对象会将各个stage提交给TaskScheduler进行进一步的任务切分。
stage:job下一级的任务操作粒度,由DAGScheduler依据是否有shuffle操作进行切分
TaskScheduler:接收DAGScheduler传过来的stage,将其转换成taskset任务集(taskset的内容和stage内容相同),最后将Taskset下发给executor进行处理
TaskSet:stage的下一级任务操作粒度,由TaskScheduler生成,其内容和stage内容相同,生成依据是数据的分区数,有几个分区,taskset里面就有几个task。stage转换成taskset的主要目的就是提高数据处理的并行度。
Task:TaskSet集合中的元素,也是最小的可执行任务粒度,由executor调度执行。
RDD:弹性分布式数据集,可以简单的理解为一个数据集合
BlockManager:spark中的文件管理器,管理spark中数据的读写io操作
CheckPoint:将数据持久化到hdfs类似的分布式文件系统上,这样即使本地的持久化数据丢失了,仍然可以从hdfs中获取,增加了系统的高可用和容错特性
另外我们这一系列的源码追踪过程,都是基于一个WordCount程序的远程debug,该wordCount的具体信息和远程debug方式可以参考这篇文章:IDEA远程调试spark-submit提交的jar_Interest1_wyt的博客-CSDN博客
边栏推荐
- Mysql间隙锁
- There are risks in trading
- Reasons for MySQL reporting 1040too many connections and Solutions
- Feign & Eureka & zuul & hystrix process
- Fundamentals of number theory and its code implementation
- There are still many things to be done in the second half of the year
- CV顶会最佳论文得主分享:好论文是怎么炼成的?
- shell脚本导入存储过程到数据库
- Use of shutter SQLite
- Research Report on China's software outsourcing industry investment strategy and the 14th five year plan Ⓡ 2022 ~ 2028
猜你喜欢

Function test process in software testing
![Idea of [developing killer]](/img/74/f4a18afd2b86373996e4ca62b50f88.png)
Idea of [developing killer]

ZABBIX 6.0 source code installation and ha configuration

Application of 5g industrial gateway in scientific and technological overload control; off-site joint law enforcement for over limit, overweight and overspeed

Content Audit Technology
MySQL报错1040Too many connections的原因以及解决方案

逆向调试入门-PE结构-输入表输出表05/07

Google Earth engine (GEE) - Global Human Settlements grid data 1975-1990-2000-2014 (p2016)

终端识别技术和管理技术

Different test techniques
随机推荐
La taille de la pile spécifiée est petite, spécifiée à la sortie 328k
Google Earth Engine(GEE)——全球人类居住区网格数据 1975-1990-2000-2014 (P2016)
声明一个抽象类Vehicle,它包含私有变量numOfWheels和公共函数Vehicle(int)、Horn()、setNumOfWheels(int)和getNumOfWheels()。子类Mot
Operator-1初识Operator
shell脚本导入存储过程到数据库
Sharing with the best paper winner of CV Summit: how is a good paper refined?
Analysis report on the development prospect and investment strategic planning of China's wafer manufacturing Ⓔ 2022 ~ 2028
逆向调试入门-PE结构-输入表输出表05/07
Class initialization and instantiation
In the next stage of digital transformation, digital twin manufacturer Youyi technology announced that it had completed a financing of more than 300 million yuan
基于mysql乐观锁实现秒杀的示例代码
科学创业三问:关于时机、痛点与重要决策
Jenkins+webhooks- multi branch parametric construction-
JS discolored Lego building blocks
How to count the status of network sockets?
图灵奖得主Judea Pearl:最近值得一读的19篇因果推断论文
Wave animation color five pointed star loader loading JS special effects
Development trend and market demand analysis report of China's high purity copper industry Ⓕ 2022 ~ 2028
请问flink mysql cdc 全量读取mysql某个表数据,对原始的mysql数据库有影响吗
彩色五角星SVG动态网页背景js特效