reswqa commented on code in PR #22176:
URL: https://github.com/apache/flink/pull/22176#discussion_r1138092444
##########
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/LeastUtilizationSlotMatchingStrategy.java:
##########
@@ -79,4 +94,19 @@ private static double calculateUtilization(
return (double) (numberRegisteredSlots - numberFreeSlots) /
numberRegisteredSlots;
}
+
+ private static double calculateUtilization(
+ TaskManagerResourceInfoSnapshot instanceResourceInfoSnapshot) {
+ if (instanceResourceInfoSnapshot.getTotalProfile() ==
ResourceProfile.UNKNOWN
+ || instanceResourceInfoSnapshot.getAvailableProfile() ==
ResourceProfile.UNKNOWN) {
+ return instanceResourceInfoSnapshot.getAllocatedSlotNumber();
+ } else {
+ return instanceResourceInfoSnapshot
+ .getTotalProfile()
+ .getCpuCores()
Review Comment:
It seems that we only consider Cpu utilization for fine-grained resource. Do
we need to consider other dimensions, such as memory?
If the first version only considers cpu resource for the time being, we
should at least add a comment to explain why we choose this strategy now.
--
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]