diff --git a/src/scala/spark/Executor.scala b/src/scala/spark/Executor.scala index 395790893b..5c3d2523bf 100644 --- a/src/scala/spark/Executor.scala +++ b/src/scala/spark/Executor.scala @@ -25,7 +25,7 @@ object Executor { // If the REPL is in use, create a ClassLoader that will be able to // read new classes defined by the REPL as the user types code classLoader = this.getClass.getClassLoader - val classDir = System.getProperty("spark.repl.classdir") + val classDir = System.getProperty("spark.repl.current.classdir") if (classDir != null) { println("Using REPL classdir: " + classDir) classLoader = new repl.ExecutorClassLoader(classDir, classLoader) diff --git a/src/scala/spark/repl/SparkInterpreter.scala b/src/scala/spark/repl/SparkInterpreter.scala index 55c6df0866..6237c83625 100644 --- a/src/scala/spark/repl/SparkInterpreter.scala +++ b/src/scala/spark/repl/SparkInterpreter.scala @@ -93,7 +93,8 @@ class SparkInterpreter(val settings: Settings, out: PrintWriter) { /** directory to save .class files to */ //val virtualDirectory = new VirtualDirectory("(memory)", None) val virtualDirectory = { - val tmpDir = new File(System.getProperty("java.io.tmpdir")) + val rootDir = new File(System.getProperty("spark.repl.classdir", + System.getProperty("java.io.tmpdir"))) var attempts = 0 val maxAttempts = 10 var outputDir: File = null @@ -104,12 +105,12 @@ class SparkInterpreter(val settings: Settings, out: PrintWriter) { "after " + maxAttempts + " attempts!") } try { - outputDir = new File(tmpDir, "spark-" + UUID.randomUUID.toString) + outputDir = new File(rootDir, "spark-" + UUID.randomUUID.toString) if (outputDir.exists() || !outputDir.mkdirs()) outputDir = null } catch { case e: IOException => ; } } - System.setProperty("spark.repl.classdir", + System.setProperty("spark.repl.current.classdir", "file://" + outputDir.getAbsolutePath + "/") if (SPARK_DEBUG_REPL) println("Output directory: " + outputDir)