SinBex commented on code in PR #21634:
URL: https://github.com/apache/flink/pull/21634#discussion_r1222776590
##########
flink-runtime/src/test/java/org/apache/flink/runtime/scheduler/benchmark/SchedulerBenchmarkUtils.java:
##########
@@ -103,17 +113,51 @@ public static ExecutionGraph createAndInitExecutionGraph(
final ComponentMainThreadExecutor mainThreadExecutor =
ComponentMainThreadExecutorServiceAdapter.forMainThread();
- final DefaultScheduler scheduler =
+ DefaultSchedulerBuilder schedulerBuilder =
new DefaultSchedulerBuilder(jobGraph, mainThreadExecutor,
scheduledExecutorService)
.setIoExecutor(scheduledExecutorService)
.setFutureExecutor(scheduledExecutorService)
.setDelayExecutor(
- new
ScheduledExecutorServiceAdapter(scheduledExecutorService))
- .build();
+ new
ScheduledExecutorServiceAdapter(scheduledExecutorService));
+ if (jobConfiguration.getExecutionMode() == ExecutionMode.BATCH) {
+ AdaptiveBatchScheduler adaptiveBatchScheduler =
+ schedulerBuilder
+ .setVertexParallelismAndInputInfosDecider(
+ createCustomParallelismDecider(
+ jobConfiguration.getParallelism()))
+ .buildAdaptiveBatchJobScheduler();
+ adaptiveBatchScheduler.initializeVerticesIfPossible();
+ return adaptiveBatchScheduler;
+ } else {
+ return schedulerBuilder.build();
+ }
+ }
+ public static ExecutionGraph createAndInitExecutionGraph(
+ List<JobVertex> jobVertices,
+ JobConfiguration jobConfiguration,
+ ScheduledExecutorService scheduledExecutorService)
+ throws Exception {
+ DefaultScheduler scheduler =
+ createAndInitScheduler(jobVertices, jobConfiguration,
scheduledExecutorService);
return scheduler.getExecutionGraph();
}
+ public static SchedulingStrategy createSchedulingStrategy(
+ JobConfiguration jobConfiguration, SchedulingTopology
schedulingTopology) {
+ TestingSchedulerOperations schedulerOperations = new
TestingSchedulerOperations();
+
+ if (jobConfiguration.getExecutionMode() == ExecutionMode.BATCH) {
Review Comment:
fixed this
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]