mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1591074 - in /mahout/trunk: CHANGELOG spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala
Date Tue, 29 Apr 2014 19:52:08 GMT
Author: ssc
Date: Tue Apr 29 19:52:08 2014
New Revision: 1591074

URL: http://svn.apache.org/r1591074
Log:
MAHOUT-1530 Custom prompt and welcome message for the Spark Shell

Modified:
    mahout/trunk/CHANGELOG
    mahout/trunk/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala

Modified: mahout/trunk/CHANGELOG
URL: http://svn.apache.org/viewvc/mahout/trunk/CHANGELOG?rev=1591074&r1=1591073&r2=1591074&view=diff
==============================================================================
--- mahout/trunk/CHANGELOG (original)
+++ mahout/trunk/CHANGELOG Tue Apr 29 19:52:08 2014
@@ -2,6 +2,8 @@ Mahout Change Log
 
 Release 1.0 - unreleased
 
+  MAHOUT-1530: Custom prompt and welcome message for the Spark Shell (ssc)
+
   MAHOUT-1521: lucene2seq - Error trying to load data from stored field (when non-indexed)
(Terry Blankers via frankscholten)
 
   MAHOUT-1310: Mahout support windows (Sergey Svinarchuk via ssc)

Modified: mahout/trunk/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala
URL: http://svn.apache.org/viewvc/mahout/trunk/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala?rev=1591074&r1=1591073&r2=1591074&view=diff
==============================================================================
--- mahout/trunk/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala
(original)
+++ mahout/trunk/spark-shell/src/main/scala/org/apache/mahout/sparkbindings/shell/MahoutSparkILoop.scala
Tue Apr 29 19:52:08 2014
@@ -3,6 +3,8 @@ package org.apache.mahout.sparkbindings.
 import org.apache.spark.repl.SparkILoop
 import org.apache.spark.{SparkConf, SparkContext}
 import org.apache.mahout.sparkbindings._
+import scala.tools.nsc.Properties
+import scala.Some
 
 class MahoutSparkILoop extends SparkILoop {
 
@@ -51,4 +53,23 @@ class MahoutSparkILoop extends SparkILoo
     sparkContext
   }
 
+  override def prompt: String = "mahout>"
+
+  override def printWelcome(): Unit = {
+    echo(
+      """
+                         _                 _
+         _ __ ___   __ _| |__   ___  _   _| |_
+        | '_ ` _ \ / _` | '_ \ / _ \| | | | __|
+        | | | | | | (_| | | | | (_) | |_| | |_
+        |_| |_| |_|\__,_|_| |_|\___/ \__,_|\__|  version 1.0
+
+      """)
+    import Properties._
+    val welcomeMsg = "Using Scala %s (%s, Java %s)".format(
+      versionString, javaVmName, javaVersion)
+    echo(welcomeMsg)
+    echo("Type in expressions to have them evaluated.")
+    echo("Type :help for more information.")
+  }
 }



Mime
View raw message