GJL commented on a change in pull request #10309: [FLINK-14909][runtime] Let 
tasks get scheduled in topological order when possible
URL: https://github.com/apache/flink/pull/10309#discussion_r351402613
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/strategy/LazyFromSourcesSchedulingStrategy.java
 ##########
 @@ -139,14 +140,27 @@ private void 
allocateSlotsAndDeployExecutionVertexIds(Set<ExecutionVertexID> ver
        private void allocateSlotsAndDeployExecutionVertices(
                        final Iterable<? extends SchedulingExecutionVertex<?, 
?>> vertices) {
 
-               schedulerOperations.allocateSlotsAndDeploy(
-                       IterableUtils.toStream(vertices)
-                               
.filter(IS_IN_CREATED_EXECUTION_STATE.and(isInputConstraintSatisfied()))
-                               .map(SchedulingExecutionVertex::getId)
-                               .map(executionVertexID -> new 
ExecutionVertexDeploymentOption(
-                                       executionVertexID,
-                                       
deploymentOptions.get(executionVertexID)))
-                               .collect(Collectors.toSet()));
+               final Set<ExecutionVertexID> verticesToDeploy = 
IterableUtils.toStream(vertices)
+                       
.filter(IS_IN_CREATED_EXECUTION_STATE.and(isInputConstraintSatisfied()))
+                       .map(SchedulingExecutionVertex::getId)
+                       .collect(Collectors.toSet());
+
+               final List<ExecutionVertexDeploymentOption> 
vertexDeploymentOptions =
+                       
createExecutionVertexDeploymentOptionsInTopologicalOrder(verticesToDeploy);
+
+               
schedulerOperations.allocateSlotsAndDeploy(vertexDeploymentOptions);
+       }
+
+       private List<ExecutionVertexDeploymentOption> 
createExecutionVertexDeploymentOptionsInTopologicalOrder(
 
 Review comment:
   Can we de-duplicate this code? Maybe introduce a Util.

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


With regards,
Apache Git Services

Reply via email to