hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ji...@apache.org
Subject [40/50] hadoop git commit: HDFS-7284. Add more debug info to BlockInfoUnderConstruction#setGenerationStampAndVerifyReplicas. (Wei-Chiu Chuang via Yongjun Zhang)
Date Tue, 27 Oct 2015 21:47:51 GMT
HDFS-7284. Add more debug info to BlockInfoUnderConstruction#setGenerationStampAndVerifyReplicas.
(Wei-Chiu Chuang via Yongjun Zhang)


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

Branch: refs/heads/HDFS-8966
Commit: 5e718de522328d1112ad38063596c204aa43f539
Parents: 3cc7377
Author: Yongjun Zhang <yzhang@cloudera.com>
Authored: Mon Oct 26 13:16:11 2015 -0700
Committer: Yongjun Zhang <yzhang@cloudera.com>
Committed: Mon Oct 26 13:25:31 2015 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hdfs/protocol/Block.java    | 13 ++++++++++++-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt            |  4 ++++
 .../hadoop/hdfs/server/blockmanagement/BlockInfo.java  |  4 ++--
 3 files changed, 18 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e718de5/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
index 710897e..2b139b2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/protocol/Block.java
@@ -153,10 +153,21 @@ public class Block implements Writable, Comparable<Block> {
   }
 
   /**
+   * A helper method to output the string representation of the Block portion of
+   * a derived class' instance.
+   *
+   * @param b the target object
+   * @return the string representation of the block
+   */
+  public static String toString(final Block b) {
+    return b.getBlockName() + "_" + b.getGenerationStamp();
+  }
+
+  /**
    */
   @Override
   public String toString() {
-    return getBlockName() + "_" + getGenerationStamp();
+    return toString(this);
   }
 
   public void appendStringTo(StringBuilder sb) {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e718de5/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 7ce5a09..c748d29 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1569,6 +1569,10 @@ Release 2.8.0 - UNRELEASED
     HDFS-4015. Safemode should count and report orphaned blocks.
     (Anu Engineer via Arpit Agarwal)
 
+    HDFS-7284. Add more debug info to
+    BlockInfoUnderConstruction#setGenerationStampAndVerifyReplicas.
+    (Wei-Chiu Chuang via Yongjun Zhang)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/5e718de5/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java
index 92a1135..e15b5ee 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockInfo.java
@@ -393,8 +393,8 @@ public abstract class BlockInfo extends Block
     List<ReplicaUnderConstruction> staleReplicas = uc.getStaleReplicas(genStamp);
     for (ReplicaUnderConstruction r : staleReplicas) {
       r.getExpectedStorageLocation().removeBlock(this);
-      NameNode.blockStateChangeLog.debug("BLOCK* Removing stale replica "
-          + "from location: {}", r.getExpectedStorageLocation());
+      NameNode.blockStateChangeLog.debug("BLOCK* Removing stale replica {}"
+          + " of {}", r, Block.toString(r));
     }
   }
 


Mime
View raw message