099-Spark-源码-SparkSubmit
作者:互联网
SparkSubmit
-- main
-- doSubmit
// 解析参数
-- parseArguments
// master => --master => yarn
// mainClass => --class => SparkPi(WordCount)
-- parse
-- submit
-- doRunMain
-- runMain
// (childArgs, childClasspath, sparkConf, childMainClass)
// 【Cluster】childMainClass => org.apache.spark.deploy.yarn.YarnClusterApplication
// 【Client 】childMainClass => SparkPi(WordCount)
-- prepareSubmitEnvironment
// Class.forName("xxxxxxx")
-- mainClass : Class = Utils.classForName(childMainClass)
// classOf[SparkApplication].isAssignableFrom(mainClass)
-- 【Cluster】a). mainClass.getConstructor().newInstance().asInstanceOf[SparkApplication]
-- 【Client 】b). new JavaMainApplication(mainClass)
-- app.start
标签:099,--,SparkPi,WordCount,源码,mainClass,childMainClass,master,Spark 来源: https://www.cnblogs.com/data-world/p/15781314.html