Skip to content

Commit

Permalink
Simplified Java quickstart skeleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Ewen committed Nov 20, 2013
1 parent 5d60a30 commit bed28cb
Showing 1 changed file with 15 additions and 27 deletions.
42 changes: 15 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,36 +127,24 @@ Import the Stratosphere source code using Maven's Import tool:

Create a new Eclipse Project that requires Stratosphere in its Build Path!

Use this skeleton as an entry point for your own Jobs: It allows you to hit the “Run as” -> “Java Application” feature of Eclipse. (You have to stop the application manually, because only one instance can run at a time)
Use this skeleton as an entry point for your own Jobs: It allows you to hit the “Run as” -> “Java Application” feature of Eclipse:

```java
public class Tutorial implements PlanAssembler, PlanAssemblerDescription {

public static void execute(Plan toExecute) throws Exception {
LocalExecutor executor = new LocalExecutor();
executor.start();
long runtime = executor.executePlan(toExecute);
System.out.println("runtime: " + runtime);
executor.stop();
}

@Override
public Plan getPlan(String... args) {
// your Plan goes here
}

@Override
public String getDescription() {
return "Usage: …. "; // TODO
}

public static void main(String[] args) throws Exception {
Tutorial tut = new Tutorial();
Plan toExecute = tut.getPlan( /* Arguments */);
execute(toExecute);
}
public class Tutorial implements PlanAssembler {

@Override
public Plan getPlan(String... args) {
// your parallel program goes here
}

public static void main(String[] args) throws Exception {
Tutorial tut = new Tutorial();
Plan toExecute = tut.getPlan(args);
long runtime = LocalExecutor.execute(toExecute);
System.out.println("Runime: " + runtime);
System.exit(0);
}
}

```

## Support
Expand Down

0 comments on commit bed28cb

Please sign in to comment.