tillrohrmann commented on a change in pull request #9928: [FLINK-12122] Add 
support for spreading slots out across all TaskExecutors
URL: https://github.com/apache/flink/pull/9928#discussion_r337464754
 
 

 ##########
 File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/slotpool/SlotSharingManager.java
 ##########
 @@ -185,18 +186,55 @@ MultiTaskSlot createRootSlot(
                return resolvedRootSlots
                        .values()
                        .stream()
-                               .flatMap((Map<AllocationID, MultiTaskSlot> map) 
-> map.values().stream())
-                               
.filter(validMultiTaskSlotAndDoesNotContain(groupId))
-                               .map((MultiTaskSlot multiTaskSlot) -> {
-                                       SlotInfo slotInfo = 
multiTaskSlot.getSlotContextFuture().join();
+                               .flatMap((Map<AllocationID, MultiTaskSlot> map) 
-> filterUsedAndReleasingMultiTaskSlots(map, groupId))
+                               .map((MultiTaskSlotInfo multiTaskSlotInfo) -> {
+                                       SlotInfo slotInfo = 
multiTaskSlotInfo.getSlotInfo();
                                        return new 
SlotSelectionStrategy.SlotInfoAndResources(
-                                                       slotInfo,
-                                                       
slotInfo.getResourceProfile().subtract(multiTaskSlot.getReservedResources()));
+                                               slotInfo,
+                                               
slotInfo.getResourceProfile().subtract(multiTaskSlotInfo.getReservedResources()),
+                                               
multiTaskSlotInfo.getTaskExecutorUtilization());
                                }).collect(Collectors.toList());
        }
 
+       private Stream<MultiTaskSlotInfo> 
filterUsedAndReleasingMultiTaskSlots(Map<AllocationID, MultiTaskSlot> 
taskExecutorSlots, AbstractID groupId) {
 
 Review comment:
   what about `createValidMultiTaskSlotInfos`?

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


With regards,
Apache Git Services

Reply via email to