Skip to content

Commit

Permalink
Merge pull request #470 from tgravescs/fix_spark_examples_yarn
Browse files Browse the repository at this point in the history
Only log error on missing jar to allow spark examples to jar.

Right now to run the spark examples on Yarn you have to use the --addJars option and put the jar in hdfs.  To make that nicer  so the user doesn't have to specify the --addJars option change it to simply log an error instead of throwing.
  • Loading branch information
pwendell committed Jan 19, 2014
2 parents 256a355 + dd56b21 commit 792d908
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions core/src/main/scala/org/apache/spark/SparkContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,11 @@ class SparkContext(
env.httpFileServer.addJar(new File(fileName))
} catch {
case e: Exception => {
// For now just log an error but allow to go through so spark examples work.
// The spark examples don't really need the jar distributed since its also
// the app jar.
logError("Error adding jar (" + e + "), was the --addJars option used?")
throw e
null
}
}
} else {
Expand All @@ -722,8 +725,10 @@ class SparkContext(
path
}
}
addedJars(key) = System.currentTimeMillis
logInfo("Added JAR " + path + " at " + key + " with timestamp " + addedJars(key))
if (key != null) {
addedJars(key) = System.currentTimeMillis
logInfo("Added JAR " + path + " at " + key + " with timestamp " + addedJars(key))
}
}
}

Expand Down

0 comments on commit 792d908

Please sign in to comment.