zhuzhurk commented on a change in pull request #11213: [FLINK-16276][tests]
Introduce a builder and factory methods to create DefaultScheduler for testing
URL: https://github.com/apache/flink/pull/11213#discussion_r385749491
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/SchedulerTestingUtils.java
##########
@@ -213,4 +267,158 @@ public static CheckpointCoordinator
getCheckpointCoordinator(SchedulerBase sched
return operatorGateway.sendOperatorEventToTask(task,
operator, evt);
}
}
+
+ /**
+ * Builder for {@link DefaultScheduler}.
+ */
+ public static class DefaultSchedulerBuilder {
+ private final JobGraph jobGraph;
+
+ private SchedulingStrategyFactory schedulingStrategyFactory;
+
+ private Logger log = LOG;
+ private BackPressureStatsTracker backPressureStatsTracker =
VoidBackPressureStatsTracker.INSTANCE;
+ private Executor ioExecutor =
java.util.concurrent.Executors.newSingleThreadExecutor();
Review comment:
Good catch!
I think we can borrow the idea of
`ExecutionGraphTestUtils#createSimpleTestGraph()` which uses
`TestingUtils.defaultExecutor()` for the `ioExecutor` and `futureExecutor`.
`delayedExecutor` could still be a `ScheduledExecutorServiceAdapter` which
wraps the `futureExecutor` by default.
----------------------------------------------------------------
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