[英]launch and submit job spark
I try to "run" spark jobs width my java application, searching, I found the following two methods: ClientsArguments
and SparkLauncher
. 我尝试“运行”我的Java应用程序宽度的
ClientsArguments
作业,进行搜索,发现以下两种方法: ClientsArguments
和SparkLauncher
。
Could someone explain to me the difference between the two? 有人可以向我解释两者之间的区别吗? The difference between launch and submit job/application Spark?
启动和提交作业/应用程序之间的区别Spark? Thank you.
谢谢。
SparkLauncher is just a wrapper library for spark-submit
, it coverts your SparkLauncher
code to spark-submit
script and then trigger the jobs. SparkLauncher只是用于
spark-submit
的包装库,它SparkLauncher
您的SparkLauncher
代码以执行spark-submit
脚本 ,然后触发作业。
The mechanism is the same with spark-submit
script, if you look at the source code of SparkLauncher, it uses ProcessBuilder
to construct the shell. 该机制与
spark-submit
脚本相同,如果您查看SparkLauncher的源代码,它使用ProcessBuilder
构造外壳。
If you want to use SparkLauncher
, you need to specify $JAVA_HOME
, $SPRAK_HOME
and other essential parameters. 如果要使用
SparkLauncher
,则需要指定$JAVA_HOME
, $SPRAK_HOME
和其他基本参数。 There are some limitation for SparkLauncher
, the machine your SparkLauncher
runs must have a $JAVA_HOME
and $SPARK_HOME
(Spark Library) which is used for SparkLauncher
locating the script and related dependencies. SparkLauncher
有一些限制,您的SparkLauncher
运行的机器必须具有$JAVA_HOME
和$SPARK_HOME
(火花库),用于SparkLauncher
定位脚本和相关的依赖项。 This is soft of impossible for some cloud environment like CloudFoundry etc. 对于某些云环境(如CloudFoundry等)来说,这是不可能的。
You could assume that SparkLauncher
equals spark-submit
script, you could choose client or master, local or yarn mode. 您可以假设
SparkLauncher
等于spark-submit
脚本,可以选择客户端或主模式,本地模式或yarn模式。
ClientsArguments
is a class for YARN script, which is only works for yarn-mode. ClientsArguments
是YARN脚本的类,仅适用于yarn-mode。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.