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


##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/allocator/SlotSharingSlotAllocator.java:
##########
@@ -150,21 +175,31 @@ public Optional<JobSchedulingPlan> 
determineParallelismAndCalculateAssignment(
      * distributed over the remaining groups.
      */
     private static Map<SlotSharingGroupId, Integer> 
determineSlotsPerSharingGroup(
-            JobInformation jobInformation, int freeSlots) {
+            JobInformation jobInformation,
+            int freeSlots,
+            int minRequiredSlots,
+            Map<SlotSharingGroupId, Integer> minSlotsPerSlotSharingGroup) {
+
         int numUnassignedSlots = freeSlots;
         int numUnassignedSlotSharingGroups = 
jobInformation.getSlotSharingGroups().size();
+        int numMinSlotsRequiredByRemainingGroups = minRequiredSlots;
 
         final Map<SlotSharingGroupId, Integer> slotSharingGroupParallelism = 
new HashMap<>();
 
         for (Map.Entry<SlotSharingGroupId, Integer> slotSharingGroup :
                 sortSlotSharingGroupsByDesiredParallelism(jobInformation)) {
+            final int minParallelism = 
minSlotsPerSlotSharingGroup.get(slotSharingGroup.getKey());

Review Comment:
   the groups need to be sorted by the difference between max and min; 
otherwise we can waste slots if a group has min==max, or more generally where 
the difference is less than an equal share of slots.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to