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

 ##########
 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:
   Sure. done in 449944386e5c6acba9b061cb7c121ba578d54fd9, along with a few 
other extracted utils.

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