瀏覽代碼

YARN-3350. YARN RackResolver spams logs with messages at info level. Contributed by Wilfred Spiegelenburg

Junping Du 10 年之前
父節點
當前提交
7f1e2f9969

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

@@ -68,6 +68,9 @@ Release 2.8.0 - UNRELEASED
     YARN-3356. Capacity Scheduler FiCaSchedulerApp should use ResourceUsage to
     track used-resources-by-label. (Wangda Tan via jianhe)
 
+    YARN-3350. YARN RackResolver spams logs with messages at info level. 
+    (Wilfred Spiegelenburg via junping_du)
+
   OPTIMIZATIONS
 
     YARN-3339. TestDockerContainerExecutor should pull a single image and not

+ 7 - 3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/util/RackResolver.java

@@ -102,11 +102,15 @@ public class RackResolver {
     String rName = null;
     if (rNameList == null || rNameList.get(0) == null) {
       rName = NetworkTopology.DEFAULT_RACK;
-      LOG.info("Couldn't resolve " + hostName + ". Falling back to "
-          + NetworkTopology.DEFAULT_RACK);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Couldn't resolve " + hostName + ". Falling back to "
+            + NetworkTopology.DEFAULT_RACK);
+      }
     } else {
       rName = rNameList.get(0);
-      LOG.info("Resolved " + hostName + " to " + rName);
+      if (LOG.isDebugEnabled()) {
+        LOG.debug("Resolved " + hostName + " to " + rName);
+      }
     }
     return new NodeBase(hostName, rName);
   }