Quickstart: Scala API

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

Requirements

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

Create Project

Use one of the following commands to create a project:

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

Inspect Project

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:

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

Build Project

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

Next Steps

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

comments powered by Disqus