You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/10/07 13:03:30 UTC

[GitHub] [flink] mxm commented on a diff in pull request #20953: [FLINK-29501] Add option to override job vertex parallelisms during job submission

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


##########
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);

Review Comment:
   The original design had an extra field in the payload to specify the override map. This was then changed to go through the configuration instead. I was under the assumption that the application mode would also use the REST API but it goes directly through the dispatcher. So you're right, this won't work. 



-- 
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-unsubscribe@flink.apache.org

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