You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mahout.apache.org by dl...@apache.org on 2014/06/10 20:47:54 UTC

git commit: (NOJIRA) shell -- context cleanup (Anand Avati via dlyubimov)

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 <av...@redhat.com>
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 <av...@redhat.com>


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 <dl...@apache.org>
Authored: Tue Jun 10 11:46:32 2014 -0700
Committer: Dmitriy Lyubimov <dl...@apache.org>
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 = {