toree-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject incubator-toree git commit: [TOREE-395] disable cell result output from console
Date Thu, 23 Mar 2017 17:22:14 GMT
Repository: incubator-toree
Updated Branches:
  refs/heads/master f4cd51e65 -> 8d974bd33


[TOREE-395] disable cell result output from console

This change makes the scala interpreter behave like
other interpreters (and kernels) by not issuing the
cell results to the console (where it is typically
captured by the Jupyter logging) and could contain
sensitive information.

Closes #116.


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

Branch: refs/heads/master
Commit: 8d974bd3377084b9d8f0e72ef790ece5a1af4148
Parents: f4cd51e
Author: Kevin Bates <kevin.bates@us.ibm.com>
Authored: Tue Mar 21 14:45:43 2017 -0700
Committer: Luciano Resende <lresende@apache.org>
Committed: Thu Mar 23 10:20:27 2017 -0700

----------------------------------------------------------------------
 .../scala/integration/InterpreterActorSpecForIntegration.scala   | 2 --
 .../test/scala/integration/PostProcessorSpecForIntegration.scala | 4 +---
 .../kernel/interpreter/scala/ScalaInterpreterSpecific.scala      | 2 +-
 .../kernel/interpreter/scala/ScalaInterpreterSpecific.scala      | 2 +-
 .../apache/toree/kernel/interpreter/scala/ScalaInterpreter.scala | 3 +--
 .../scala/AddExternalJarMagicSpecForIntegration.scala            | 2 --
 6 files changed, 4 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/kernel/src/test/scala/integration/InterpreterActorSpecForIntegration.scala
----------------------------------------------------------------------
diff --git a/kernel/src/test/scala/integration/InterpreterActorSpecForIntegration.scala b/kernel/src/test/scala/integration/InterpreterActorSpecForIntegration.scala
index a9a4ce4..cc151a8 100644
--- a/kernel/src/test/scala/integration/InterpreterActorSpecForIntegration.scala
+++ b/kernel/src/test/scala/integration/InterpreterActorSpecForIntegration.scala
@@ -57,8 +57,6 @@ class InterpreterActorSpecForIntegration extends TestKit(
 
   private val output = new ByteArrayOutputStream()
   private val interpreter = new ScalaInterpreter {
-    override protected val multiOutputStream = MultiOutputStream(List(mock[OutputStream],
lastResultOut))
-
     override protected def bindKernelVariable(kernel: KernelLike): Unit = { }
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/kernel/src/test/scala/integration/PostProcessorSpecForIntegration.scala
----------------------------------------------------------------------
diff --git a/kernel/src/test/scala/integration/PostProcessorSpecForIntegration.scala b/kernel/src/test/scala/integration/PostProcessorSpecForIntegration.scala
index 8b392ad..5bf70ae 100644
--- a/kernel/src/test/scala/integration/PostProcessorSpecForIntegration.scala
+++ b/kernel/src/test/scala/integration/PostProcessorSpecForIntegration.scala
@@ -35,9 +35,7 @@ class PostProcessorSpecForIntegration extends FunSpec with Matchers
   before {
     // TODO: Move instantiation and start of interpreter to a beforeAll
     //       for performance improvements
-    scalaInterpreter = new ScalaInterpreter {
-      override protected val multiOutputStream = MultiOutputStream(List(mock[OutputStream],
lastResultOut))
-    }
+    scalaInterpreter = new ScalaInterpreter
 
     scalaInterpreter.init(mock[Kernel])
 

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/scala-interpreter/src/main/scala-2.10/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/main/scala-2.10/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
b/scala-interpreter/src/main/scala-2.10/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
index 0cb8ce3..b8a8535 100644
--- a/scala-interpreter/src/main/scala-2.10/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
+++ b/scala-interpreter/src/main/scala-2.10/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
@@ -303,7 +303,7 @@ trait ScalaInterpreterSpecific { this: ScalaInterpreter =>
     taskManager.start()
 
     sparkIMain =
-      newSparkIMain(settings, new JPrintWriter(multiOutputStream, true))
+      newSparkIMain(settings, new JPrintWriter(lastResultOut, true))
 
 
     //logger.debug("Initializing interpreter")

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
b/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
index 98f7599..3cf9407 100644
--- a/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
+++ b/scala-interpreter/src/main/scala-2.11/org/apache/toree/kernel/interpreter/scala/ScalaInterpreterSpecific.scala
@@ -278,7 +278,7 @@ trait ScalaInterpreterSpecific extends SettingsProducerLike { this: ScalaInterpr
     logger.debug("Initializing task manager")
     taskManager.start()
 
-    iMain = newIMain(settings, new JPrintWriter(multiOutputStream, true))
+    iMain = newIMain(settings, new JPrintWriter(lastResultOut, true))
 
     //logger.debug("Initializing interpreter")
     //iMain.initializeSynchronous()

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/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 ce98353..debf638 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
@@ -29,7 +29,7 @@ import org.apache.spark.repl.Main
 
 import org.apache.toree.interpreter._
 import org.apache.toree.kernel.api.{KernelLike, KernelOptions}
-import org.apache.toree.utils.{MultiOutputStream, TaskManager}
+import org.apache.toree.utils.TaskManager
 import org.slf4j.LoggerFactory
 import org.apache.toree.kernel.BuildInfo
 
@@ -48,7 +48,6 @@ class ScalaInterpreter(private val config:Config = ConfigFactory.load) extends
I
 
    protected val lastResultOut = new ByteArrayOutputStream()
 
-   protected val multiOutputStream = MultiOutputStream(List(Console.out, lastResultOut))
    private[scala] var taskManager: TaskManager = _
 
   /** Since the ScalaInterpreter can be started without a kernel, we need to ensure that
we can compile things.

http://git-wip-us.apache.org/repos/asf/incubator-toree/blob/8d974bd3/scala-interpreter/src/test/scala/integration/interpreter/scala/AddExternalJarMagicSpecForIntegration.scala
----------------------------------------------------------------------
diff --git a/scala-interpreter/src/test/scala/integration/interpreter/scala/AddExternalJarMagicSpecForIntegration.scala
b/scala-interpreter/src/test/scala/integration/interpreter/scala/AddExternalJarMagicSpecForIntegration.scala
index 6d06e72..d16a22b 100644
--- a/scala-interpreter/src/test/scala/integration/interpreter/scala/AddExternalJarMagicSpecForIntegration.scala
+++ b/scala-interpreter/src/test/scala/integration/interpreter/scala/AddExternalJarMagicSpecForIntegration.scala
@@ -38,8 +38,6 @@ class AddExternalJarMagicSpecForIntegration
 
   before {
     interpreter = new ScalaInterpreter {
-      override protected val multiOutputStream = MultiOutputStream(List(mock[OutputStream],
lastResultOut))
-
       override protected def bindKernelVariable(kernel: KernelLike): Unit = { }
     }
     // interpreter.start()


Mime
View raw message