tillrohrmann commented on a change in pull request #15071:
URL: https://github.com/apache/flink/pull/15071#discussion_r586411150
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/AdaptiveScheduler.java
##########
@@ -248,9 +250,24 @@ public AdaptiveScheduler(
declarativeSlotPool::reserveFreeSlot,
declarativeSlotPool::freeReservedSlot);
- for (JobVertex vertex : jobGraph.getVertices()) {
- if (vertex.getParallelism() ==
ExecutionConfig.PARALLELISM_DEFAULT) {
- vertex.setParallelism(1);
+ if (configuration.get(JobManagerOptions.SCHEDULER_MODE)
+ == SchedulerExecutionMode.REACTIVE) {
+ LOG.info("Modifying job parallelism for running in reactive
mode.");
+ for (JobVertex vertex : jobGraph.getVertices()) {
+ if (vertex.getMaxParallelism() ==
JobVertex.MAX_PARALLELISM_DEFAULT) {
+
vertex.setParallelism(Transformation.UPPER_BOUND_MAX_PARALLELISM);
+
vertex.setMaxParallelism(Transformation.UPPER_BOUND_MAX_PARALLELISM);
+ } else {
+ vertex.setParallelism(vertex.getMaxParallelism());
+ }
+ }
+ } else {
+ // non-reactive mode (test execution with adaptive scheduler):
ensure parallelism is set
+ // for all vertices.
+ for (JobVertex vertex : jobGraph.getVertices()) {
+ if (vertex.getParallelism() ==
ExecutionConfig.PARALLELISM_DEFAULT) {
+ vertex.setParallelism(1);
+ }
}
Review comment:
Moreover, I would suggest to require that the `JobGraph` is already
properly configured when it arrives at the `AdaptiveScheduler`.
----------------------------------------------------------------
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]