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 Tue, 19 Jul 2016 22:19:47 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2.8 d8181a8cb -> 91f47ab5f


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

(cherry picked from commit f7dabe3addf3f6eb32ea9b8ec1354fb442ce4222)
(cherry picked from commit 2685e16f381532d53aea413ce1c0a14181ee7c89)


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

Branch: refs/heads/branch-2.8
Commit: 91f47ab5f97989872339a934ea351bf68a077553
Parents: d8181a8
Author: Akira Ajisaka <aajisaka@apache.org>
Authored: Tue Jul 19 15:13:01 2016 -0700
Committer: Akira Ajisaka <aajisaka@apache.org>
Committed: Tue Jul 19 15:19:02 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/hadoop/blob/91f47ab5/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 2de8aac..207ac5b 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
@@ -1210,16 +1210,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