Skip to content

Commit

Permalink
Merge pull request #115 from yaooqinn/KYUUBI-114
Browse files Browse the repository at this point in the history
[KYUUBI-114] kyuubi should work well with spark local mode
  • Loading branch information
yaooqinn committed Nov 5, 2018
2 parents 8a30b63 + e39c56f commit 34af4d0
Showing 1 changed file with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,26 @@ 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 _ => printErrorAndExit("Kyuubi only supports yarn as master.")
case m if m.startsWith("local") => args.master = "local"
case _ => printErrorAndExit("Kyuubi only supports yarn, local as master.")
}

args.deployMode match {
Expand All @@ -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,
Expand Down

0 comments on commit 34af4d0

Please sign in to comment.