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



##########
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:
       Currently, we already have the available/total resources of the TM. For 
fine-grained resource management, slots are dynamically created with different 
resource profiles. It would be good to let user know the what type of slot is 
allocated and which job it is allocated for. I don't think it will help a lot 
to reorganize it to slots + number of slots of that type. In the worst case, 
that will increase the data size instead.
   
   After an offline discussion with @vthinkxie , I think we can add only this 
information to `TaskManagerDetailsInfo`.




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