You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by wa...@apache.org on 2017/05/02 17:54:06 UTC

hadoop git commit: HADOOP-14369. NetworkTopology calls expensive toString() when logging. Contributed by Inigo Goiri.

Repository: hadoop
Updated Branches:
  refs/heads/trunk dc77255a7 -> dcc292d7d


HADOOP-14369. NetworkTopology calls expensive toString() when logging. Contributed by Inigo Goiri.


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/dcc292d7
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/dcc292d7
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/dcc292d7

Branch: refs/heads/trunk
Commit: dcc292d7ded200a4976f6d348952ecba10f01db2
Parents: dc77255
Author: Andrew Wang <wa...@apache.org>
Authored: Tue May 2 10:51:20 2017 -0700
Committer: Andrew Wang <wa...@apache.org>
Committed: Tue May 2 10:51:20 2017 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/net/NetworkTopology.java     | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/dcc292d7/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/net/NetworkTopology.java
----------------------------------------------------------------------
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 f8cecdd..1018d58 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
@@ -130,8 +130,8 @@ public class NetworkTopology {
           "Not allow to add an inner node: "+NodeBase.getPath(node));
       }
       if ((depthOfAllLeaves != -1) && (depthOfAllLeaves != newDepth)) {
-        LOG.error("Error: can't add leaf node " + NodeBase.getPath(node) +
-            " at depth " + newDepth + " to topology:\n" + this.toString());
+        LOG.error("Error: can't add leaf node {} at depth {} to topology:{}\n",
+            NodeBase.getPath(node), newDepth, this);
         throw new InvalidTopologyException("Failed to add " + NodeBase.getPath(node) +
             ": You cannot have a rack and a non-rack node at the same " +
             "level of the network topology.");
@@ -153,7 +153,7 @@ public class NetworkTopology {
           }
         }
       }
-      LOG.debug("NetworkTopology became:\n{}", this.toString());
+      LOG.debug("NetworkTopology became:\n{}", this);
     } finally {
       netlock.writeLock().unlock();
     }
@@ -226,7 +226,7 @@ public class NetworkTopology {
           numOfRacks--;
         }
       }
-      LOG.debug("NetworkTopology became:\n{}", this.toString());
+      LOG.debug("NetworkTopology became:\n{}", this);
     } finally {
       netlock.writeLock().unlock();
     }
@@ -525,7 +525,7 @@ public class NetworkTopology {
     }
     if (numOfDatanodes == 0) {
       LOG.debug("Failed to find datanode (scope=\"{}\" excludedScope=\"{}\").",
-          String.valueOf(scope), String.valueOf(excludedScope));
+          scope, excludedScope);
       return null;
     }
     Node ret = null;
@@ -538,7 +538,7 @@ public class NetworkTopology {
     }
     LOG.debug("Choosing random from {} available nodes on node {},"
         + " scope={}, excludedScope={}, excludeNodes={}", availableNodes,
-        innerNode.toString(), scope, excludedScope, excludedNodes);
+        innerNode, scope, excludedScope, excludedNodes);
     if (availableNodes > 0) {
       do {
         int leaveIndex = r.nextInt(numOfDatanodes);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org