Skip to content
Snippets Groups Projects
Commit 1d767967 authored by Sandy Ryza's avatar Sandy Ryza Committed by Thomas Graves
Browse files

SPARK-3014. Log a more informative messages in a couple failure scenario...

...s

Author: Sandy Ryza <sandy@cloudera.com>

Closes #1934 from sryza/sandy-spark-3014 and squashes the following commits:

ae19cc1 [Sandy Ryza] SPARK-3014. Log a more informative messages in a couple failure scenarios
parent 15a56459
No related branches found
No related tags found
No related merge requests found
......@@ -18,7 +18,7 @@
package org.apache.spark.deploy
import java.io.{File, PrintStream}
import java.lang.reflect.InvocationTargetException
import java.lang.reflect.{Modifier, InvocationTargetException}
import java.net.URL
import scala.collection.mutable.{ArrayBuffer, HashMap, Map}
......@@ -323,7 +323,9 @@ object SparkSubmit {
}
val mainMethod = mainClass.getMethod("main", new Array[String](0).getClass)
if (!Modifier.isStatic(mainMethod.getModifiers)) {
throw new IllegalStateException("The main method in the given main class must be static")
}
try {
mainMethod.invoke(null, childArgs.toArray)
} catch {
......
......@@ -283,11 +283,9 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
}
val sparkContext = sparkContextRef.get()
assert(sparkContext != null || count >= numTries)
if (sparkContext == null) {
logError(
"Unable to retrieve sparkContext inspite of waiting for %d, numTries = %d".format(
count * waitTime, numTries))
logError(("SparkContext did not initialize after waiting for %d ms. Please check earlier"
+ " log output for errors. Failing the application.").format(numTries * waitTime))
}
sparkContext
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment