rmetzger commented on a change in pull request #15071:
URL: https://github.com/apache/flink/pull/15071#discussion_r591186994



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java
##########
@@ -287,6 +291,23 @@ public void onUnknownDeploymentsOf(
 
         log.info("Initializing job {} ({}).", jobName, jid);
 
+        if 
(jobMasterConfiguration.getConfiguration().get(JobManagerOptions.SCHEDULER_MODE)
+                == SchedulerExecutionMode.REACTIVE) {
+            Preconditions.checkState(
+                    slotPoolServiceSchedulerFactory.getSchedulerType()
+                            == JobManagerOptions.SchedulerType.Adaptive,
+                    "Expecting Adaptive Scheduler for reactive mode");
+            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());
+                }
+            }

Review comment:
       This is a very good idea, I added it to the change!




----------------------------------------------------------------
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]


Reply via email to