vahmed-hamdy commented on code in PR #26308:
URL: https://github.com/apache/flink/pull/26308#discussion_r1999518598
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/DefaultResourceAllocationStrategy.java:
##########
@@ -526,8 +536,35 @@ public int tryFulfilledRequirementWithResource(
}
}
- private enum LeastUtilizationResourceMatchingStrategy implements
ResourceMatchingStrategy {
- INSTANCE;
+ private static class PrioritizedResourceMatchingStrategy implements
ResourceMatchingStrategy {
+ private final Comparator<InternalResourceInfo> resourceInfoComparator;
+
+ /**
+ * Returns a {@link PrioritizedResourceMatchingStrategy} that
prioritizes the resource with
+ * the least utilization, used to evenly distribute slots to workers.
+ *
+ * @return least utilization prioritized resource matching strategy.
+ */
+ public static PrioritizedResourceMatchingStrategy leastUtilization() {
Review Comment:
well the DefaultResourceAllocationStrategy is instantiated with the
SlotManager instantiation which should be done once per resource manager
instance.
--
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]