zentol commented on code in PR #20953:
URL: https://github.com/apache/flink/pull/20953#discussion_r989020962


##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/job/JobSubmitHandler.java:
##########
@@ -148,11 +150,30 @@ private CompletableFuture<JobGraph> loadJobGraph(
                                         HttpResponseStatus.BAD_REQUEST,
                                         e));
                     }
+                    try {
+                        applyParallelismOverrides(jobGraph);
+                    } catch (Exception e) {
+                        throw new CompletionException(
+                                new RestHandlerException(
+                                        "Failed to apply parallelism 
overrides",
+                                        
HttpResponseStatus.INTERNAL_SERVER_ERROR,
+                                        e));
+                    }
                     return jobGraph;
                 },
                 executor);
     }
 
+    private void applyParallelismOverrides(JobGraph jobGraph) {
+        Map<String, Integer> overrides = 
configuration.get(PipelineOptions.PARALLELISM_OVERRIDES);
+        for (JobVertex vertex : jobGraph.getVertices()) {
+            Integer override = overrides.get(vertex.getID().toHexString());
+            if (override != null) {
+                vertex.setParallelism(override);

Review Comment:
   These should be logged, at least on debug, as otherwise good luck figuring 
out where this comes from when the job fails because the parallelism exceeds 
the maxParallelism.



-- 
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: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to