博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
spark的shell脚本分析
阅读量:2110 次
发布时间:2019-04-29

本文共 1249 字,大约阅读时间需要 4 分钟。

  1. bin目录: { spark-shell , spark-sql } --> spark-submit–> spark-class
  2. sbin目录:

part1: bin目录

spark-shell

function main() {    export SPARK_SUBMIT_OPTS    "${SPARK_HOME}"/bin/spark-submit --class org.apache.spark.repl.Main --name "Spark shell" "$@"}main "$@"

spark-sql

exec "${SPARK_HOME}"/bin/spark-submit --class org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver "$@"

spark-submit

exec "${SPARK_HOME}"/bin/spark-class org.apache.spark.deploy.SparkSubmit "$@"

spark-class

# For testsbuild_command() {  "${JAVA_HOME}/bin/java" -Xmx128m -cp "="${SPARK_HOME}/jars/*" org.apache.spark.launcher.Main "$@"  printf "%d\0" $?}CMD=()while IFS= read -d '' -r ARG; do  CMD+=("$ARG")done < <(build_command "$@")COUNT=${#CMD[@]}LAST=$((COUNT - 1))LAUNCHER_EXIT_CODE=${CMD[$LAST]}CMD=("${CMD[@]:0:$LAST}")exec "${CMD[@]}"

part2: 调用spark的scala类

scala类org.apache.spark.deploy.SparkSubmit -main函数

def main(args: Array[String]): Unit = {    val appArgs = new SparkSubmitArguments(args)        if (appArgs.verbose) {       printStream.println(appArgs)    }        appArgs.action match {      case SparkSubmitAction.SUBMIT => submit(appArgs)      case SparkSubmitAction.KILL => kill(appArgs)      case SparkSubmitAction.REQUEST_STATUS => requestStatus(appArgs)    }  }

转载地址:http://zvdef.baihongyu.com/

你可能感兴趣的文章
(PAT 1096) Consecutive Factors (质因子分解)
查看>>
(PAT 1019) General Palindromic Number (进制转换)
查看>>
(PAT 1073) Scientific Notation (字符串模拟题)
查看>>
(PAT 1080) Graduate Admission (排序)
查看>>
Play on Words UVA - 10129 (欧拉路径)
查看>>
mininet+floodlight搭建sdn环境并创建简答topo
查看>>
【linux】nohup和&的作用
查看>>
【UML】《Theach yourself uml in 24hours》——hour4
查看>>
Set、WeakSet、Map以及WeakMap结构基本知识点
查看>>
【NLP学习笔记】(一)Gensim基本使用方法
查看>>
【NLP学习笔记】(二)gensim使用之Topics and Transformations
查看>>
【深度学习】LSTM的架构及公式
查看>>
【深度学习】GRU的结构图及公式
查看>>
【python】re模块常用方法
查看>>
剑指offer 19.二叉树的镜像
查看>>
剑指offer 20.顺时针打印矩阵
查看>>
剑指offer 21.包含min函数的栈
查看>>
剑指offer 23.从上往下打印二叉树
查看>>
剑指offer 25.二叉树中和为某一值的路径
查看>>
剑指offer 26. 数组中出现次数超过一半的数字
查看>>