Skip to content
Snippets Groups Projects
Commit 36ccb353 authored by Prashant Sharma's avatar Prashant Sharma
Browse files

Changed spark context as lazy val to become just val.

parent 19b0256a
No related branches found
No related tags found
No related merge requests found
...@@ -885,6 +885,8 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter, ...@@ -885,6 +885,8 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter,
val autorun = replProps.replAutorunCode.option flatMap (f => io.File(f).safeSlurp()) val autorun = replProps.replAutorunCode.option flatMap (f => io.File(f).safeSlurp())
if (autorun.isDefined) intp.quietRun(autorun.get) if (autorun.isDefined) intp.quietRun(autorun.get)
}) })
addThunk(printWelcome())
addThunk(initializeSpark()) addThunk(initializeSpark())
loadFiles(settings) loadFiles(settings)
...@@ -905,7 +907,7 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter, ...@@ -905,7 +907,7 @@ class SparkILoop(in0: Option[BufferedReader], protected val out: JPrintWriter,
intp.initializeSynchronous() intp.initializeSynchronous()
postInitialization() postInitialization()
} }
printWelcome() // printWelcome()
try loop() try loop()
catch AbstractOrMissingHandler() catch AbstractOrMissingHandler()
......
...@@ -117,11 +117,11 @@ trait SparkILoopInit { ...@@ -117,11 +117,11 @@ trait SparkILoopInit {
def initializeSpark() { def initializeSpark() {
intp.beQuietDuring { intp.beQuietDuring {
command(""" command("""
@transient lazy val sc = spark.repl.Main.interp.createSparkContext(); @transient val sc = spark.repl.Main.interp.createSparkContext();
""") """)
command("import spark.SparkContext._"); command("import spark.SparkContext._");
} }
echo("... Spark context available as sc.") echo("Spark context available as sc.")
} }
// code to be executed only after the interpreter is initialized // code to be executed only after the interpreter is initialized
......
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