zentol commented on a change in pull request #9165: [FLINK-13055] [runtime]
Leverage JM tracked partitions to find out unavailable partitions in …
URL: https://github.com/apache/flink/pull/9165#discussion_r305316618
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/AdaptedRestartPipelinedRegionStrategyNGConcurrentFailoverTest.java
##########
@@ -250,37 +253,38 @@ public void
testSkipFailoverIfExecutionStateIsNotRunning() throws Exception {
*/
private ExecutionGraph createExecutionGraph() throws Exception {
- final JobInformation jobInformation = new
DummyJobInformation(TEST_JOB_ID, "test job");
- final SimpleSlotProvider slotProvider = new
SimpleSlotProvider(TEST_JOB_ID, DEFAULT_PARALLELISM);
-
- final Time timeout = Time.seconds(10L);
- final ExecutionGraph graph = new ExecutionGraph(
- jobInformation,
- TestingUtils.defaultExecutor(),
- TestingUtils.defaultExecutor(),
- timeout,
- manuallyTriggeredRestartStrategy,
- TestAdaptedRestartPipelinedRegionStrategyNG::new,
- slotProvider,
- getClass().getClassLoader(),
- VoidBlobWriter.getInstance(),
- timeout);
-
- JobVertex v1 = new JobVertex("vertex1");
+ final JobVertex v1 = new JobVertex("vertex1");
v1.setInvokableClass(NoOpInvokable.class);
v1.setParallelism(DEFAULT_PARALLELISM);
- JobVertex v2 = new JobVertex("vertex2");
+ final JobVertex v2 = new JobVertex("vertex2");
v2.setInvokableClass(NoOpInvokable.class);
v2.setParallelism(DEFAULT_PARALLELISM);
v2.connectNewDataSetAsInput(v1, DistributionPattern.ALL_TO_ALL,
ResultPartitionType.BLOCKING);
- JobGraph jg = new JobGraph(TEST_JOB_ID, "testjob", v1, v2);
-
graph.attachJobGraph(jg.getVerticesSortedTopologicallyFromSources());
+ final JobGraph jg = new JobGraph(TEST_JOB_ID, "testjob", v1,
v2);
+
+ final SimpleSlotProvider slotProvider = new
SimpleSlotProvider(TEST_JOB_ID, DEFAULT_PARALLELISM);
+
+ final Configuration jmConfig = new Configuration();
+
jmConfig.setBoolean(JobManagerOptions.FORCE_PARTITION_RELEASE_ON_CONSUMPTION,
false);
+
+ final PartitionTracker partitionTracker = new
PartitionTrackerImpl(
+ jg.getJobID(),
+ NettyShuffleMaster.INSTANCE,
+ ignored -> Optional.empty());
+
+ final ExecutionGraph eg = new
ExecutionGraphTestUtils.TestingExecutionGraphBuilder(jg)
+ .setRestartStrategy(manuallyTriggeredRestartStrategy)
+
.setFailoverStrategyFactory(TestAdaptedRestartPipelinedRegionStrategyNG::new)
+ .setSlotProvider(slotProvider)
+ .setJobMasterConfig(jmConfig)
+ .setPartitionTracker(partitionTracker)
+ .build();
- graph.start(componentMainThreadExecutor);
+ eg.start(componentMainThreadExecutor);
- return graph;
+ return eg;
Review comment:
let's stick to the existing naming
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services