You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/08/28 13:28:13 UTC

[GitHub] [flink] zentol commented on a change in pull request #9550: [FLINK-13805] Properly forward cause for slot removal in SlotManager

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

 ##########
 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:
   can be static

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


With regards,
Apache Git Services