瀏覽代碼

YARN-1301. Added the INFO level log of the non-empty blacklist additions and removals inside ApplicationMasterService. Contributed by Tsuyoshi Ozawa.
svn merge --ignore-ancestry -c 1572400 ../../trunk/


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2.4@1572403 13f79535-47bb-0310-9956-ffa450edef68

Zhijie Shen 11 年之前
父節點
當前提交
cc3d840129

+ 3 - 0
hadoop-yarn-project/CHANGES.txt

@@ -196,6 +196,9 @@ Release 2.4.0 - UNRELEASED
     YARN-1749. Updated application-history related configs to reflect the latest
     YARN-1749. Updated application-history related configs to reflect the latest
     reality and to be consistently named. (Zhijie Shen via vinodkv)
     reality and to be consistently named. (Zhijie Shen via vinodkv)
 
 
+    YARN-1301. Added the INFO level log of the non-empty blacklist additions
+    and removals inside ApplicationMasterService. (Tsuyoshi Ozawa via zjshen)
+
   OPTIMIZATIONS
   OPTIMIZATIONS
 
 
   BUG FIXES
   BUG FIXES

+ 8 - 2
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.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.HashSet;
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
@@ -438,10 +439,10 @@ public class ApplicationMasterService extends AbstractService implements
           request.getResourceBlacklistRequest();
           request.getResourceBlacklistRequest();
       List<String> blacklistAdditions =
       List<String> blacklistAdditions =
           (blacklistRequest != null) ?
           (blacklistRequest != null) ?
-              blacklistRequest.getBlacklistAdditions() : null;
+              blacklistRequest.getBlacklistAdditions() : Collections.EMPTY_LIST;
       List<String> blacklistRemovals =
       List<String> blacklistRemovals =
           (blacklistRequest != null) ?
           (blacklistRequest != null) ?
-              blacklistRequest.getBlacklistRemovals() : null;
+              blacklistRequest.getBlacklistRemovals() : Collections.EMPTY_LIST;
 
 
       // sanity check
       // sanity check
       try {
       try {
@@ -478,6 +479,11 @@ public class ApplicationMasterService extends AbstractService implements
           this.rScheduler.allocate(appAttemptId, ask, release, 
           this.rScheduler.allocate(appAttemptId, ask, release, 
               blacklistAdditions, blacklistRemovals);
               blacklistAdditions, blacklistRemovals);
 
 
+      if (!blacklistAdditions.isEmpty() || !blacklistRemovals.isEmpty()) {
+        LOG.info("blacklist are updated in Scheduler." +
+            "blacklistAdditions: " + blacklistAdditions + ", " +
+            "blacklistRemovals: " + blacklistRemovals);
+      }
       RMAppAttempt appAttempt = app.getRMAppAttempt(appAttemptId);
       RMAppAttempt appAttempt = app.getRMAppAttempt(appAttemptId);
       AllocateResponse allocateResponse =
       AllocateResponse allocateResponse =
           recordFactory.newRecordInstance(AllocateResponse.class);
           recordFactory.newRecordInstance(AllocateResponse.class);