zentol commented on code in PR #22883:
URL: https://github.com/apache/flink/pull/22883#discussion_r1246587326
##########
flink-runtime/src/main/java/org/apache/flink/runtime/scheduler/adaptive/allocator/SlotSharingSlotAllocator.java:
##########
@@ -150,34 +183,58 @@ 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;
+
+ Map<SlotSharingGroupId, Integer> maxParallelismForSlotSharingGroups =
+
getMaxParallelismForSlotSharingGroups(jobInformation.getVertices());
final Map<SlotSharingGroupId, Integer> slotSharingGroupParallelism =
new HashMap<>();
- for (Map.Entry<SlotSharingGroupId, Integer> slotSharingGroup :
- sortSlotSharingGroupsByDesiredParallelism(jobInformation)) {
+ for (SlotSharingGroupId slotSharingGroup :
+
sortSlotSharingGroupsByHighestParallelismRange(jobInformation)) {
+ final int minParallelism =
minSlotsPerSlotSharingGroup.get(slotSharingGroup);
+
+ // if we reached this point we know we have more slots than we
need to fulfill the
+ // minimum requirements for each slot sharing group.
+ // this means that a certain number of slots are already
implicitly reserved (to fulfill
+ // the minimum requirement of other groups); so we only need to
distribute the remaining
+ // "optional" slots while only accounting for the requirements
beyond the minimum
+
+ // the number of slots we can use beyond the minimum
Review Comment:
```suggestion
// the number of slots this group can use beyond the minimum
```
--
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]