Skip to content

Commit

Permalink
change logic to loadEnvironments
Browse files Browse the repository at this point in the history
  • Loading branch information
WangTaoTheTonic committed May 24, 2015
1 parent ebd9ea0 commit e65699a
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -42,8 +42,8 @@ private[spark] class ClientArguments(args: Array[String], sparkConf: SparkConf)
var amCores: Int = 1
var appName: String = "Spark"
var priority = 0
var principal: String = sparkConf.get("spark.yarn.principal")
var keytab: String = sparkConf.get("spark.yarn.keytab")
var principal: String = null
var keytab: String = null
def isClusterMode: Boolean = userClass != null

private var driverMemory: Int = 512 // MB
Expand Down Expand Up @@ -98,6 +98,12 @@ private[spark] class ClientArguments(args: Array[String], sparkConf: SparkConf)

numExecutors = initialNumExecutors
}
principal = Option(principal)
.orElse(sparkConf.getOption("spark.yarn.principal"))
.orNull
keytab = Option(keytab)
.orElse(sparkConf.getOption("spark.yarn.keytab"))
.orNull
}

/**
Expand Down

0 comments on commit e65699a

Please sign in to comment.