diff options
author | Tobias Schlatter <tobias@meisch.ch> | 2015-02-01 21:43:49 -0800 |
---|---|---|
committer | Patrick Wendell <patrick@databricks.com> | 2015-02-01 21:43:49 -0800 |
commit | 9f0a6e1838f62845f2a02d82cde16401e48aef4a (patch) | |
tree | dc47ab8cd81d3b9d915577cce87219aee98ef3bf /repl/src | |
parent | a15f6e31fc216d0d39bc1578e0da11b068b7821c (diff) | |
download | spark-9f0a6e1838f62845f2a02d82cde16401e48aef4a.tar.gz spark-9f0a6e1838f62845f2a02d82cde16401e48aef4a.tar.bz2 spark-9f0a6e1838f62845f2a02d82cde16401e48aef4a.zip |
[SPARK-5353] Log failures in REPL class loading
Author: Tobias Schlatter <tobias@meisch.ch>
Closes #4130 from gzm0/log-repl-loading and squashes the following commits:
4fa0582 [Tobias Schlatter] Log failures in REPL class loading
Diffstat (limited to 'repl/src')
-rw-r--r-- | repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala b/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala index 5ee325008a..b46df12da8 100644 --- a/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala +++ b/repl/src/main/scala/org/apache/spark/repl/ExecutorClassLoader.scala @@ -17,13 +17,13 @@ package org.apache.spark.repl -import java.io.{ByteArrayOutputStream, InputStream} +import java.io.{ByteArrayOutputStream, InputStream, FileNotFoundException} import java.net.{URI, URL, URLEncoder} import java.util.concurrent.{Executors, ExecutorService} import org.apache.hadoop.fs.{FileSystem, Path} -import org.apache.spark.{SparkConf, SparkEnv} +import org.apache.spark.{SparkConf, SparkEnv, Logging} import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.util.Utils import org.apache.spark.util.ParentClassLoader @@ -37,7 +37,7 @@ import com.esotericsoftware.reflectasm.shaded.org.objectweb.asm.Opcodes._ * Allows the user to specify if user class path should be first */ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader, - userClassPathFirst: Boolean) extends ClassLoader { + userClassPathFirst: Boolean) extends ClassLoader with Logging { val uri = new URI(classUri) val directory = uri.getPath @@ -91,7 +91,14 @@ class ExecutorClassLoader(conf: SparkConf, classUri: String, parent: ClassLoader inputStream.close() Some(defineClass(name, bytes, 0, bytes.length)) } catch { - case e: Exception => None + case e: FileNotFoundException => + // We did not find the class + logDebug(s"Did not load class $name from REPL class server at $uri", e) + None + case e: Exception => + // Something bad happened while checking if the class exists + logError(s"Failed to check existence of class $name on REPL class server at $uri", e) + None } } |