Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Allow SPARK_JAR to be set in system properties
  • Loading branch information
epahomov committed Mar 5, 2014
commit fd4bd8a8e3125f7f0f5b2845b6f0f12795731c09
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ trait ClientBase extends Logging {
// TODO(harvey): This could just go in ClientArguments.
def validateArgs() = {
Map(
(System.getenv("SPARK_JAR") == null) -> "Error: You must set SPARK_JAR environment variable!",
((System.getenv("SPARK_JAR") == null) && (System.getProperty("SPARK_JAR") == null)) -> "Error: You must set SPARK_JAR environment variable!",
((args.userJar == null && args.amClass == classOf[ApplicationMaster].getName) ->
"Error: You must specify a user jar when running in standalone mode!"),
(args.userClass == null) -> "Error: You must specify a user class!",
Expand Down Expand Up @@ -205,8 +205,12 @@ trait ClientBase extends Logging {

val statCache: Map[URI, FileStatus] = HashMap[URI, FileStatus]()

val sparkJar = System.getenv("SPARK_JAR") match {
case null => System.getProperty("SPARK_JAR")
case s: String => s
}
Map(
ClientBase.SPARK_JAR -> System.getenv("SPARK_JAR"), ClientBase.APP_JAR -> args.userJar,
ClientBase.SPARK_JAR -> sparkJar, ClientBase.APP_JAR -> args.userJar,
ClientBase.LOG4J_PROP -> System.getenv("SPARK_LOG4J_CONF")
).foreach { case(destName, _localPath) =>
val localPath: String = if (_localPath != null) _localPath.trim() else ""
Expand Down