tillrohrmann commented on a change in pull request #9550: [FLINK-13805]
Properly forward cause for slot removal in SlotManager
URL: https://github.com/apache/flink/pull/9550#discussion_r319025744
##########
File path:
flink-runtime/src/test/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManagerImplTest.java
##########
@@ -1256,19 +1258,27 @@ public void
testNotifyFailedAllocationWhenTaskManagerTerminated() throws Excepti
@Nonnull
private SlotReport createSlotReport(ResourceID taskExecutorResourceId,
int numberSlots) {
- return createSlotReport(taskExecutorResourceId, numberSlots,
ResourceProfile.UNKNOWN);
+ return createSlotReport(taskExecutorResourceId, numberSlots,
ResourceProfile.UNKNOWN, this::createEmptySlotStatus);
}
@Nonnull
- private SlotReport createSlotReport(ResourceID taskExecutorResourceId,
int numberSlots, ResourceProfile resourceProfile) {
+ private SlotReport createSlotReport(
+ ResourceID taskExecutorResourceId,
+ int numberSlots,
+ ResourceProfile resourceProfile,
+ BiFunction<SlotID, ResourceProfile, SlotStatus>
slotStatusFactory) {
final Set<SlotStatus> slotStatusSet = new
HashSet<>(numberSlots);
for (int i = 0; i < numberSlots; i++) {
- slotStatusSet.add(new SlotStatus(new
SlotID(taskExecutorResourceId, i), resourceProfile));
+ slotStatusSet.add(slotStatusFactory.apply(new
SlotID(taskExecutorResourceId, i), resourceProfile));
}
return new SlotReport(slotStatusSet);
}
+ private SlotStatus createEmptySlotStatus(SlotID slotId, ResourceProfile
resourceProfile) {
Review comment:
Could point. Will change it.
----------------------------------------------------------------
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]
With regards,
Apache Git Services