Repository: mahout Updated Branches: refs/heads/master 8c529ccff -> b044a0779
(NOJIRA) shell -- context cleanup (Anand Avati via dlyubimov) This closes apache/mahout#15 Squashed commit of the following: commit 0407577bff365028ceef9798d5835f12a81bc941 Author: Anand Avati <[email protected]> Date: Mon Jun 9 22:05:14 2014 -0700 MAHOUT-1529: spark-shell - cleanup sdc Renaming @sc to @sdc has left open the shutdown part. Spark depends on 'implicit sc' to be set by the shell invoker. mahout> Stopping spark context. <console>:29: error: not found: value sc sc.stop() ^ So override sparkCleanUp() and call @sdc.stop() Signed-off-by: Anand Avati <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/mahout/repo Commit: http://git-wip-us.apache.org/repos/asf/mahout/commit/b044a077 Tree: http://git-wip-us.apache.org/repos/asf/mahout/tree/b044a077 Diff: http://git-wip-us.apache.org/repos/asf/mahout/diff/b044a077 Branch: refs/heads/master Commit: b044a07797a8fef23d10f10126615c9b7db659bb Parents: 8c529cc Author: Dmitriy Lyubimov <[email protected]> Authored: Tue Jun 10 11:46:32 2014 -0700 Committer: Dmitriy Lyubimov <[email protected]> Committed: Tue Jun 10 11:46:32 2014 -0700 ---------------------------------------------------------------------- .../apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mahout/blob/b044a077/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala ---------------------------------------------------------------------- diff --git a/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala b/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala index 020a2f9..d03a5a9 100644 --- a/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala +++ b/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala @@ -67,6 +67,13 @@ class MahoutSparkILoop extends SparkILoop { } } + override def sparkCleanUp() { + echo("Stopping Spark context.") + intp.beQuietDuring { + command("sdc.stop()") + } + } + override def prompt: String = "mahout> " override def printWelcome(): Unit = {
