use of org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup in project flink by apache.
the class PipelinedRegionSchedulingITCase method createJobGraph.
private JobGraph createJobGraph(final int parallelism) {
final SlotSharingGroup group1 = new SlotSharingGroup();
final JobVertex source1 = new JobVertex("source1");
source1.setInvokableClass(PipelinedSender.class);
source1.setParallelism(parallelism * 2);
source1.setSlotSharingGroup(group1);
final SlotSharingGroup group2 = new SlotSharingGroup();
final JobVertex source2 = new JobVertex("source2");
source2.setInvokableClass(NoOpInvokable.class);
source2.setParallelism(parallelism);
source2.setSlotSharingGroup(group2);
final JobVertex sink = new JobVertex("sink");
sink.setInvokableClass(Receiver.class);
sink.setParallelism(parallelism);
sink.setSlotSharingGroup(group1);
sink.connectNewDataSetAsInput(source1, DistributionPattern.POINTWISE, ResultPartitionType.PIPELINED);
sink.connectNewDataSetAsInput(source2, DistributionPattern.ALL_TO_ALL, ResultPartitionType.BLOCKING);
return JobGraphTestUtils.batchJobGraph(source1, source2, sink);
}
use of org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup in project flink by apache.
the class SchedulingITCase method createJobGraph.
@Nonnull
private JobGraph createJobGraph(long delay, int parallelism) throws IOException {
SlotSharingGroup slotSharingGroup = new SlotSharingGroup();
final JobVertex source = new JobVertex("source");
source.setInvokableClass(OneTimeFailingInvokable.class);
source.setParallelism(parallelism);
source.setSlotSharingGroup(slotSharingGroup);
final JobVertex sink = new JobVertex("sink");
sink.setInvokableClass(NoOpInvokable.class);
sink.setParallelism(parallelism);
sink.setSlotSharingGroup(slotSharingGroup);
sink.connectNewDataSetAsInput(source, DistributionPattern.POINTWISE, ResultPartitionType.PIPELINED);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setRestartStrategy(RestartStrategies.fixedDelayRestart(1, delay));
return JobGraphBuilder.newStreamingJobGraphBuilder().addJobVertices(Arrays.asList(source, sink)).setExecutionConfig(executionConfig).build();
}
use of org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup in project flink by apache.
the class ShuffleCompressionITCase method createJobGraph.
private static JobGraph createJobGraph(ResultPartitionType resultPartitionType, ExecutionMode executionMode) throws IOException {
SlotSharingGroup slotSharingGroup = new SlotSharingGroup();
JobVertex source = new JobVertex("source");
source.setInvokableClass(LongValueSource.class);
source.setParallelism(PARALLELISM);
source.setSlotSharingGroup(slotSharingGroup);
JobVertex sink = new JobVertex("sink");
sink.setInvokableClass(ResultVerifyingSink.class);
sink.setParallelism(PARALLELISM);
sink.setSlotSharingGroup(slotSharingGroup);
sink.connectNewDataSetAsInput(source, DistributionPattern.ALL_TO_ALL, resultPartitionType);
ExecutionConfig executionConfig = new ExecutionConfig();
executionConfig.setExecutionMode(executionMode);
return JobGraphBuilder.newBatchJobGraphBuilder().addJobVertices(Arrays.asList(source, sink)).setExecutionConfig(executionConfig).build();
}
Aggregations