zentol commented on a change in pull request #15249:
URL: https://github.com/apache/flink/pull/15249#discussion_r597124183



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/FineGrainedSlotManager.java
##########
@@ -636,6 +637,15 @@ public ResourceProfile getFreeResourceOf(InstanceID 
instanceID) {
         return taskManagerTracker.getRegisteredResourceOf(instanceID);
     }
 
+    @Override
+    public Collection<SlotInfo> getAllocatedSlotsOf(InstanceID instanceID) {
+        return taskManagerTracker.getRegisteredTaskManager(instanceID)
+                .map(TaskManagerInfo::getAllocatedSlots).map(Map::values)
+                .orElse(Collections.emptyList()).stream()
+                .map(slot -> new SlotInfo(slot.getJobId(), 
slot.getResourceProfile()))
+                .collect(Collectors.toList());

Review comment:
       But why bother with slots in the first place? Isn't the whole point for 
fine-grained resource management to not really bother with slots but 
_resources_ instead, so why then expose it as slots again in the UI?
   
   Why not just say "Job A has allocated X memory and Y CPUs on TM Z to run N 
tasks."
   That is some really digestible information.
   
   What value does it bring to know this instead:
   "Job as has N slots on TM Z, where slot 1 uses X_1 memory any Y_1 cpus, and 
slot 2 uses X_2 memory and Y_2 cpus, and ..."




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

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


Reply via email to