felixcheung commented on a change in pull request #3378: [ZEPPELIN-4187] Bump up version of Scala from 2.11.8 to 2.11.12 URL: https://github.com/apache/zeppelin/pull/3378#discussion_r292744100
########## File path: flink/src/main/scala/org/apache/zeppelin/flink/FlinkScalaInterpreter.scala ########## @@ -231,3 +233,71 @@ class FlinkScalaInterpreter(val properties: Properties) { def getBatchTableEnviroment(): BatchTableEnvironment = this.btenv } + +private object FlinkScalaInterpreter { + + /** + * This is a hack to call `loopPostInit` at `ILoop`. At higher version of Scala such + * as 2.11.12, `loopPostInit` became a nested function which is inaccessible. Here, + * we redefine `loopPostInit` at Scala's 2.11.8 side and ignore `loadInitFiles` being called at + * Scala 2.11.12 since here we do not have to load files. + * + * Both methods `loopPostInit` and `unleashAndSetPhase` are redefined, and `phaseCommand` and + * `asyncMessage` are being called via reflection since both exist in Scala 2.11.8 and 2.11.12. + * + * Please see the codes below: + * https://github.com/scala/scala/blob/v2.11.8/src/repl/scala/tools/nsc/interpreter/ILoop.scala + * https://github.com/scala/scala/blob/v2.11.12/src/repl/scala/tools/nsc/interpreter/ILoop.scala + * + * See also ZEPPELIN-3810/ZEPPELIN-4187. + */ + private def loopPostInit(interpreter: FlinkScalaInterpreter): Unit = { + import StdReplTags._ + import scala.reflect.{classTag, io} + + val sparkILoop = interpreter.flinkILoop Review comment: `sparkILoop`? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services