Quick Start: Scala

Start working on your Stratosphere Scala program in a few simple steps.

The only requirements are working Maven 3.0.4 (or higher) and Java 6.x (or higher) installations.

Use one of the following commands to create a project:

$ curl https://raw.githubusercontent.com/stratosphere/stratosphere-quickstart/master/quickstart-scala.sh | bash
$ mvn archetype:generate                             \
    -DarchetypeGroupId=eu.stratosphere               \
    -DarchetypeArtifactId=quickstart-scala           \
    -DarchetypeVersion=0.4                  
This allows you to name your newly created project. It will interactively ask you for the groupId, artifactId, and package name.

There will be a new directory in your working directory. If you've used the curl approach, the directory is called quickstart. Otherwise, it has the name of your artifactId.

The sample project is a Maven project, which contains a sample scala Job that implements Word Count. Please note that the RunJobLocal and RunJobRemote objects allow you to start Stratosphere in a development/testing mode.

We recommend to import this project into your IDE. For Eclipse, you need the following plugins, which you can install from the provided Eclipse Update Sites:

  • Eclipse 4.x:
    • Scala IDE (http://download.scala-ide.org/sdk/e38/scala210/stable/site)
    • m2eclipse-scala (http://alchim31.free.fr/m2e-scala/update-site)
    • Build Helper Maven Plugin (https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.15.0/N/0.15.0.201206251206/)
  • Eclipse 3.7:
    • Scala IDE (http://download.scala-ide.org/sdk/e37/scala210/stable/site)
    • m2eclipse-scala (http://alchim31.free.fr/m2e-scala/update-site)
    • Build Helper Maven Plugin (https://repository.sonatype.org/content/repositories/forge-sites/m2e-extras/0.14.0/N/0.14.0.201109282148/)

The IntelliJ IDE also supports Maven and offers a plugin for Scala development.

If you want to build your project, go to your project directory and issue the mvn clean package command. You will find a jar that runs on every Stratosphere cluster in target/stratosphere-project-0.1-SNAPSHOT.jar.

Write your application! If you have any trouble, ask on our GitHub page (open an issue) or on our Mailing list. We are happy to provide help.