diff --git hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java index b5f90c6..70fd69f 100644 --- hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java +++ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ApplicationMasterService.java @@ -22,6 +22,7 @@ import java.net.InetSocketAddress; import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -447,10 +448,10 @@ public AllocateResponse allocate(AllocateRequest request) request.getResourceBlacklistRequest(); List blacklistAdditions = (blacklistRequest != null) ? - blacklistRequest.getBlacklistAdditions() : null; + blacklistRequest.getBlacklistAdditions() : Collections.EMPTY_LIST; List blacklistRemovals = (blacklistRequest != null) ? - blacklistRequest.getBlacklistRemovals() : null; + blacklistRequest.getBlacklistRemovals() : Collections.EMPTY_LIST; // sanity check try { @@ -487,6 +488,11 @@ public AllocateResponse allocate(AllocateRequest request) this.rScheduler.allocate(appAttemptId, ask, release, blacklistAdditions, blacklistRemovals); + if (!blacklistAdditions.isEmpty() || !blacklistRemovals.isEmpty()) { + LOG.info("blacklist are updated in Scheduler." + + "blacklistAdditions: " + blacklistAdditions + ", " + + "blacklistRemovals: " + blacklistRemovals); + } RMAppAttempt appAttempt = app.getRMAppAttempt(appAttemptId); AllocateResponse allocateResponse = recordFactory.newRecordInstance(AllocateResponse.class);