From d9e4ad78ca284fb92397bcb56e3abd98870e5039 Mon Sep 17 00:00:00 2001 From: Brahma Reddy Battula Date: Thu, 6 Oct 2016 17:47:31 +0530 Subject: [PATCH] HDFS-10963. Reduce log level when network topology cannot find enough datanodes. Contributed by Xiao chen (cherry picked from commit b90fc70d671481564e468550c770c925f25d7db0) --- .../src/main/java/org/apache/hadoop/net/NetworkTopology.java | 2 +- .../server/blockmanagement/BlockPlacementPolicyDefault.java | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java index cf5b17678b0..0e6c253c5bc 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java @@ -813,7 +813,7 @@ public class NetworkTopology { } } if (numOfDatanodes == 0) { - LOG.warn("Failed to find datanode (scope=\"{}\" excludedScope=\"{}\").", + LOG.debug("Failed to find datanode (scope=\"{}\" excludedScope=\"{}\").", String.valueOf(scope), String.valueOf(excludedScope)); return null; } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java index dc5ed9bcd96..4bc479a6538 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockPlacementPolicyDefault.java @@ -48,8 +48,9 @@ import com.google.common.annotations.VisibleForTesting; public class BlockPlacementPolicyDefault extends BlockPlacementPolicy { private static final String enableDebugLogging = - "For more information, please enable DEBUG log level on " - + BlockPlacementPolicy.class.getName(); + "For more information, please enable DEBUG log level on " + + BlockPlacementPolicy.class.getName() + " and " + + NetworkTopology.class.getName(); private static final ThreadLocal debugLoggingBuilder = new ThreadLocal() {