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



##########
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:
       This will scale terribly. Do we really need information for every single 
slot?
   Why not slots + number of slots of that type? Or total acquired resources? 
Or available/total resources of the TM?
   




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to