rkhachatryan commented on code in PR #21981:
URL: https://github.com/apache/flink/pull/21981#discussion_r1116355057


##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/allocator/SlotSharingSlotAllocator.java:
##########
@@ -121,16 +133,13 @@ public Optional<VertexParallelismWithSlotSharing> 
determineParallelism(
                             slotSharingGroupParallelism.get(
                                     slotSharingGroup.getSlotSharingGroupId()));
 
-            final Iterable<ExecutionSlotSharingGroup> 
sharedSlotToVertexAssignment =
+            final List<ExecutionSlotSharingGroup> sharedSlotToVertexAssignment 
=
                     createExecutionSlotSharingGroups(vertexParallelism);
 
-            for (ExecutionSlotSharingGroup executionSlotSharingGroup :
-                    sharedSlotToVertexAssignment) {
-                final SlotInfo slotInfo = slotIterator.next();
-
-                assignments.add(
-                        new 
ExecutionSlotSharingGroupAndSlot(executionSlotSharingGroup, slotInfo));
-            }
+            SlotAssigner.AssignmentResult result =
+                    slotAssigner.assignSlots(freeSlots, 
sharedSlotToVertexAssignment);
+            assignments.addAll(result.assignments);
+            freeSlots = result.remainingSlots;

Review Comment:
   Fixed by restructuring the code and going through all the groups in on go: 
2fc84d83884c1f342d46fec02d961d4f73eb4219 .. 
4fa93e3756fad77cf2dbc92bf77614aa39cc28fe.



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