You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "zentol (via GitHub)" <gi...@apache.org> on 2023/03/28 12:11:15 UTC

[GitHub] [flink] zentol commented on a diff in pull request #22288: [FLINK-31590] Add mechanics to the JobMaster for handling job resource requirements.

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


##########
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobMaster.java:
##########
@@ -937,6 +944,34 @@ public CompletableFuture<Acknowledge> notifyNewBlockedNodes(Collection<BlockedNo
         return CompletableFuture.completedFuture(Acknowledge.get());
     }
 
+    @Override
+    public CompletableFuture<JobResourceRequirements> requestJobResourceRequirements() {
+        return CompletableFuture.completedFuture(schedulerNG.requestJobResourceRequirements());
+    }
+
+    @Override
+    public CompletableFuture<Acknowledge> updateJobResourceRequirements(
+            JobResourceRequirements jobResourceRequirements) {
+        final Map<JobVertexID, Integer> maxParallelismPerJobVertex = new HashMap<>();
+        for (JobVertex vertex : jobGraph.getVertices()) {
+            maxParallelismPerJobVertex.put(
+                    vertex.getID(), SchedulerBase.getDefaultMaxParallelism(vertex));
+        }
+        final List<String> validationErrors =
+                JobResourceRequirements.validate(
+                        jobResourceRequirements, maxParallelismPerJobVertex);
+        if (validationErrors.isEmpty()) {
+            schedulerNG.updateJobResourceRequirements(jobResourceRequirements);

Review Comment:
   We will handle this being unsupported by the DefaultScheduler directly in the REST layer.
   We won't even call this method if the adaptive scheduler isn't used.



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