use of org.apache.flink.runtime.jobgraph.JobType in project flink by apache.
the class BlockingShuffleITCase method createJobGraph.
private JobGraph createJobGraph(int numRecordsToSend, boolean deletePartitionFile) {
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, 0L));
env.setBufferTimeout(-1);
env.setParallelism(numTaskManagers * numSlotsPerTaskManager);
DataStream<String> source = env.addSource(new StringSource(numRecordsToSend));
source.rebalance().map((MapFunction<String, String>) value -> value).broadcast().addSink(new VerifySink(deletePartitionFile));
StreamGraph streamGraph = env.getStreamGraph();
streamGraph.setGlobalStreamExchangeMode(GlobalStreamExchangeMode.ALL_EDGES_BLOCKING);
// a scheduler supporting batch jobs is required for this job graph, because it contains
// blocking data exchanges.
// The scheduler is selected based on the JobType.
streamGraph.setJobType(JobType.BATCH);
return StreamingJobGraphGenerator.createJobGraph(streamGraph);
}
Aggregations