hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aajis...@apache.org
Subject hadoop git commit: HDFS-10620. StringBuilder created and appended even if logging is disabled. Contributed by Staffan Friberg.
Date Fri, 24 Feb 2017 19:17:28 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 19c5b3d62 -> bd3c2a2ee


HDFS-10620. StringBuilder created and appended even if logging is disabled. Contributed by
Staffan Friberg.


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

Branch: refs/heads/branch-2
Commit: bd3c2a2ee951529c39d91a5201e12ab0e202fd49
Parents: 19c5b3d
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Sat Feb 25 04:15:43 2017 +0900
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Sat Feb 25 04:17:17 2017 +0900

----------------------------------------------------------------------
 .../hadoop/hdfs/server/blockmanagement/BlockManager.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/bd3c2a2e/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
index f2805e2..b06996a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java
@@ -1303,16 +1303,19 @@ public class BlockManager implements BlockStatsMXBean {
     if (!isPopulatingReplQueues()) {
       return;
     }
-    StringBuilder datanodes = new StringBuilder();
+    StringBuilder datanodes = blockLog.isDebugEnabled()
+        ? new StringBuilder() : null;
     for (DatanodeStorageInfo storage : blocksMap.getStorages(b)) {
       if (storage.getState() != State.NORMAL) {
         continue;
       }
       final DatanodeDescriptor node = storage.getDatanodeDescriptor();
       invalidateBlocks.add(b, node, false);
-      datanodes.append(node).append(" ");
+      if (datanodes != null) {
+        datanodes.append(node).append(" ");
+      }
     }
-    if (datanodes.length() != 0) {
+    if (datanodes != null && datanodes.length() != 0) {
       blockLog.debug("BLOCK* addToInvalidates: {} {}", b, datanodes);
     }
   }


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


Mime
View raw message