版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuxintdrh/article/details/88856716
SparkDriver 用于提交用户的应用程序,
一、SparkConf
负责SparkContext的配置参数加载, 主要通过ConcurrentHashMap来维护各种spark.*
的配置属性
class SparkConf(loadDefaults: Boolean) extends Cloneable with Logging with Serializable {
import SparkConf._
/** Create a SparkConf that loads defaults from system properties and the classpath */
def this() = this(true)
/** 维护一个ConcurrentHashMap 来存储spark配置 */
private val settings = new ConcurrentHashMap[String, String]()
if (loadDefaults) {
loadFromSystemProperties(false)
}
/**
* 加载spark.*的配置
*/
private[spark] def loadFromSystemProperties(silent: Boolean): SparkConf = {
// Load any spark.* system properties, 只加载spark.*的配置
for ((key, value) <- Utils.getSystemProperties if key.startsWith("spark.")) {
set(key, value, silent)
}
this
}
}
。。。。。
二、SparkContext
- 2.1.1、创建SecurityManager
- 2.1.2、创建RpcEnv
2.2、创建RDD清理器metadataCleaner
2.3、创建并初始化SparkUI
2.4、Hadoop相关配置及Executor环境变量的设置
2.5、创建TaskScheduler
2.6、创建和启动DAGScheduler
2.7、TaskScheduler的启动
2.8、初始化BlockManager
2.9、启动测量系统MetricsSystem
2.10、创建和启动Executor分配管理器ExecutorAllocationManager
2.11、ContextCleaner的创建和启动
2.12、Spark环境更新
2.13、创建DAGSchedulerSource和BlockManagerSource
2.14、将SparkContext标记为激活