// This example will join two streams with a sliding window. One which emits
// people's grades and one which emits people's salaries.
public static void main(String[] args) throws Exception {
StreamExecutionEnvironment env = StreamExecutionEnvironment.createLocalEnvironment(
PARALLELISM).setBufferTimeout(100);
DataStream<Tuple3<String, Integer, Long>> grades = env.addSource(new GradeSource(),
SOURCE_PARALLELISM);
DataStream<Tuple3<String, Integer, Long>> salaries = env.addSource(new SalarySource(),
SOURCE_PARALLELISM);
DataStream<Tuple3<String, Integer, Integer>> joinedStream = grades.connect(salaries)
.flatMap(new WindowJoinTask());
System.out.println("(NAME, GRADE, SALARY)");
joinedStream.print();
env.execute();
}