toree-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mariusvniek...@apache.org
Subject [1/2] incubator-toree git commit: TOREE-389: Ensure bindings are run before user code.
Date Sat, 11 Mar 2017 17:17:57 GMT
Repository: incubator-toree
Updated Branches:
  refs/heads/master 15061a48e -> c96f67c9a


TOREE-389: Ensure bindings are run before user code.


Project: http://git-wip-us.apache.org/repos/asf/incubator-toree/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-toree/commit/8f1775d9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-toree/tree/8f1775d9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-toree/diff/8f1775d9

Branch: refs/heads/master
Commit: 8f1775d9dcdc56dd4f3a7c44abf0c36ae0417444
Parents: 0eb3bb2
Author: Ryan Blue <blue@apache.org>
Authored: Wed Mar 1 15:16:34 2017 -0800
Committer: Ryan Blue <blue@apache.org>
Committed: Fri Mar 3 17:16:37 2017 -0800

----------------------------------------------------------------------
 .../kernel/interpreter/scala/ScalaInterpreter.scala    | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8f1775d9/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
b/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
index 360476b..ce98353 100644
--- a/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
+++ b/scala-interpreter/src/main/scala/org/apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala
@@ -86,16 +86,15 @@ class ScalaInterpreter(private val config:Config = ConfigFactory.load)
extends I
 
      start()
      bindKernelVariable(kernel)
- 
+
+     // ensure bindings are defined before allowing user code to run
+     bindSparkSession()
+     bindSparkContext()
+     defineImplicits()
+
      this
    }
 
-  override def postInit(): Unit = {
-    bindSparkSession()
-    bindSparkContext()
-    defineImplicits()
-  }
-
    protected[scala] def buildClasspath(classLoader: ClassLoader): String = {
 
      def toClassLoaderList( classLoader: ClassLoader ): Seq[ClassLoader] = {


Mime
View raw message