fix #114 kyuubi should work well with spark local mode

This commit is contained in:
Kent Yao 2018-11-05 17:40:46 +08:00
parent 8a30b63c37
commit 65448dda04

View File

@ -89,16 +89,25 @@ object KyuubiSubmit extends Logging {
*/
private[deploy]
def prepareSubmitEnvironment(args: SparkSubmitArguments): (Seq[String], Map[String, String]) = {
// Return values
// Make sure YARN is included in our build if we're trying to use it
def checkYarnSupport: Unit = {
if (!Utils.classIsLoadable("org.apache.spark.deploy.yarn.Client")) {
printErrorAndExit(
"Could not load YARN classes. Spark may not have been compiled with YARN support.")
}
}
val childClasspath = new ArrayBuffer[String]()
val sysProps = new HashMap[String, String]()
args.master match {
case "yarn" =>
case "yarn-client" =>
case "yarn" => checkYarnSupport
case "yarn-client" | "yarn-cluster" =>
checkYarnSupport
printWarning(s"Master ${args.master} is deprecated since 2.0." +
" Please use master \"yarn\" with specified deploy mode instead.")
args.master = "yarn"
case m if m.startsWith("local") => args.master = "local"
case _ => printErrorAndExit("Kyuubi only supports yarn as master.")
}
@ -110,12 +119,6 @@ object KyuubiSubmit extends Logging {
}
// Make sure YARN is included in our build if we're trying to use it
if (!Utils.classIsLoadable("org.apache.spark.deploy.yarn.Client")) {
printErrorAndExit(
"Could not load YARN classes. Spark may not have been compiled with YARN support.")
}
Seq(
"spark.master" -> args.master,
"spark.submit.deployMode" -> args.deployMode,