Search in sources :

Example 51 with SlotSharingGroup

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);
}
Also used : JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) SlotSharingGroup(org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup)

Example 52 with SlotSharingGroup

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();
}
Also used : JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) SlotSharingGroup(org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup) Nonnull(javax.annotation.Nonnull)

Example 53 with SlotSharingGroup

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();
}
Also used : JobVertex(org.apache.flink.runtime.jobgraph.JobVertex) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) SlotSharingGroup(org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup)

Aggregations

SlotSharingGroup (org.apache.flink.runtime.jobmanager.scheduler.SlotSharingGroup)53 JobVertex (org.apache.flink.runtime.jobgraph.JobVertex)35 Test (org.junit.Test)30 JobGraph (org.apache.flink.runtime.jobgraph.JobGraph)18 JobVertexID (org.apache.flink.runtime.jobgraph.JobVertexID)14 JobID (org.apache.flink.api.common.JobID)11 HashMap (java.util.HashMap)8 Configuration (org.apache.flink.configuration.Configuration)8 ArrayList (java.util.ArrayList)7 HashSet (java.util.HashSet)6 Map (java.util.Map)6 Set (java.util.Set)6 ExecutionConfig (org.apache.flink.api.common.ExecutionConfig)6 ResultPartitionType (org.apache.flink.runtime.io.network.partition.ResultPartitionType)6 CoLocationGroup (org.apache.flink.runtime.jobmanager.scheduler.CoLocationGroup)6 IOException (java.io.IOException)5 Arrays (java.util.Arrays)5 IdentityHashMap (java.util.IdentityHashMap)5 Collections (java.util.Collections)4 Comparator (java.util.Comparator)4