Skip to content

Commit b1e28e8

Browse files
committed
working
1 parent fdb084a commit b1e28e8

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

repl/scala-2.11/src/main/scala/org/apache/spark/repl/SparkILoop.scala

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package org.apache.spark.repl
1919

2020
import java.io.BufferedReader
2121

22+
import scala.concurrent.Await
23+
2224
// scalastyle:off println
2325
import scala.Predef.{println => _, _}
2426
// scalastyle:on println
@@ -167,6 +169,7 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
167169
)
168170
// power mode setup
169171
if (isReplPower) enablePowerMode(true)
172+
initializeSpark()
170173
loadInitFiles()
171174
// SI-7418 Now, and only now, can we enable TAB completion.
172175
in.postInit()
@@ -203,26 +206,28 @@ class SparkILoop(in0: Option[BufferedReader], out: JPrintWriter)
203206
}
204207
}
205208
def startup(): String = withSuppressedSettings {
206-
// while we go fire up the REPL
209+
// let them start typing
207210
val splash = preLoop
208211

212+
// while we go fire up the REPL
209213
try {
210214
// don't allow ancient sbt to hijack the reader
211215
savingReader {
212216
createInterpreter()
213217
}
214218
intp.initializeSynchronous()
215-
initializeSpark()
216219

217-
// globalFuture = Future successful true
220+
val field = classOf[ILoop].getDeclaredFields.filter(_.getName.contains("globalFuture")).head
221+
field.setAccessible(true)
222+
field.set(this, Future successful true)
223+
224+
// val globalFuture: Future[Boolean] =
218225
if (intp.reporter.hasErrors) {
219226
echo("Interpreter encountered errors during initialization!")
220227
null
221228
} else {
222229
loopPostInit()
223-
224230
printWelcome()
225-
// let them start typing
226231
splash.start()
227232

228233
val line = splash.line // what they typed in while they were waiting

0 commit comments

Comments
 (0)