aboutsummaryrefslogtreecommitdiff
path: root/repl
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-06-22 17:12:39 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-06-22 17:14:44 -0700
commitb5df1cd668e45fd0cc22c1666136d05548cae3e9 (patch)
tree7b617dc11a48b1edf23307ee3beb55832116b78e /repl
parent3e61beff7b41217a40afdccd1e413d9b90fe6e54 (diff)
downloadspark-b5df1cd668e45fd0cc22c1666136d05548cae3e9.tar.gz
spark-b5df1cd668e45fd0cc22c1666136d05548cae3e9.tar.bz2
spark-b5df1cd668e45fd0cc22c1666136d05548cae3e9.zip
ADD_JARS environment variable for spark-shell
Diffstat (limited to 'repl')
-rw-r--r--repl/src/main/scala/spark/repl/SparkILoop.scala9
1 files changed, 7 insertions, 2 deletions
diff --git a/repl/src/main/scala/spark/repl/SparkILoop.scala b/repl/src/main/scala/spark/repl/SparkILoop.scala
index 23556dbc8f..86eed090d0 100644
--- a/repl/src/main/scala/spark/repl/SparkILoop.scala
+++ b/repl/src/main/scala/spark/repl/SparkILoop.scala
@@ -822,7 +822,7 @@ class SparkILoop(in0: Option[BufferedReader], val out: PrintWriter, val master:
spark.repl.Main.interp.out.println("Spark context available as sc.");
spark.repl.Main.interp.out.flush();
""")
- command("import spark.SparkContext._");
+ command("import spark.SparkContext._")
}
echo("Type in expressions to have them evaluated.")
echo("Type :help for more information.")
@@ -838,7 +838,8 @@ class SparkILoop(in0: Option[BufferedReader], val out: PrintWriter, val master:
if (prop != null) prop else "local"
}
}
- sparkContext = new SparkContext(master, "Spark shell")
+ val jars = Option(System.getenv("ADD_JARS")).map(_.split(',')).getOrElse(new Array[String](0))
+ sparkContext = new SparkContext(master, "Spark shell", System.getenv("SPARK_HOME"), jars)
sparkContext
}
@@ -850,6 +851,10 @@ class SparkILoop(in0: Option[BufferedReader], val out: PrintWriter, val master:
printWelcome()
echo("Initializing interpreter...")
+ // Add JARS specified in Spark's ADD_JARS variable to classpath
+ val jars = Option(System.getenv("ADD_JARS")).map(_.split(',')).getOrElse(new Array[String](0))
+ jars.foreach(settings.classpath.append(_))
+
this.settings = settings
createInterpreter()