aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAndrew Ash <ash211@gmail.com>2013-03-28 17:47:37 -0300
committerAndrew Ash <ash211@gmail.com>2013-03-28 17:47:37 -0300
commit4e2c96538339e627013c8c0c58bd30494cc8d13b (patch)
tree43985988b2a8097d58a1a109d86909c88de5ce7e /docs
parentbc36ee4fbbe3ad3b7e15fbdba53de42a29b81a9f (diff)
downloadspark-4e2c96538339e627013c8c0c58bd30494cc8d13b.tar.gz
spark-4e2c96538339e627013c8c0c58bd30494cc8d13b.tar.bz2
spark-4e2c96538339e627013c8c0c58bd30494cc8d13b.zip
Don't use deprecated Application in example
As of 2.9.0 extending from Application is not recommended http://www.scala-lang.org/api/2.9.3/index.html#scala.Application
Diffstat (limited to 'docs')
-rw-r--r--docs/quick-start.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/docs/quick-start.md b/docs/quick-start.md
index 216f7c9cc5..5c80d2ed3a 100644
--- a/docs/quick-start.md
+++ b/docs/quick-start.md
@@ -111,14 +111,16 @@ We'll create a very simple Spark job in Scala. So simple, in fact, that it's nam
import spark.SparkContext
import SparkContext._
-object SimpleJob extends Application {
- val logFile = "/var/log/syslog" // Should be some file on your system
- val sc = new SparkContext("local", "Simple Job", "$YOUR_SPARK_HOME",
- List("target/scala-{{site.SCALA_VERSION}}/simple-project_{{site.SCALA_VERSION}}-1.0.jar"))
- val logData = sc.textFile(logFile, 2).cache()
- val numAs = logData.filter(line => line.contains("a")).count()
- val numBs = logData.filter(line => line.contains("b")).count()
- println("Lines with a: %s, Lines with b: %s".format(numAs, numBs))
+object SimpleJob {
+ def main(args: Array[String]) {
+ val logFile = "/var/log/syslog" // Should be some file on your system
+ val sc = new SparkContext("local", "Simple Job", "$YOUR_SPARK_HOME",
+ List("target/scala-{{site.SCALA_VERSION}}/simple-project_{{site.SCALA_VERSION}}-1.0.jar"))
+ val logData = sc.textFile(logFile, 2).cache()
+ val numAs = logData.filter(line => line.contains("a")).count()
+ val numBs = logData.filter(line => line.contains("b")).count()
+ println("Lines with a: %s, Lines with b: %s".format(numAs, numBs))
+ }
}
{% endhighlight %}