KarmaGYZ commented on a change in pull request #15249:
URL: https://github.com/apache/flink/pull/15249#discussion_r597364645
##########
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:
I think how to expose that information to the user is depends on the
WebUI and might be out of the scope of this PR. In current interface, we give
the UI flexibility to choose how to aggregate it.
Also, user might want to know the explicit resource of each task, especially
for external resources.
--
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]