HDFS-2061. Two minor bugs in BlockManager block report processing. Contributed by Matt Foley.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hdfs/trunk@1134458 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 673187c..f059e47 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -517,6 +517,8 @@
BUG FIXES
+ HDFS-2061. Two minor bugs in BlockManager block report processing. (mattf)
+
HDFS-1449. Fix test failures - ExtendedBlock must return
block file name in #getBlockName(). (suresh)
diff --git a/src/java/org/apache/hadoop/hdfs/server/namenode/BlockManager.java b/src/java/org/apache/hadoop/hdfs/server/namenode/BlockManager.java
index aaa908d..57d061c 100644
--- a/src/java/org/apache/hadoop/hdfs/server/namenode/BlockManager.java
+++ b/src/java/org/apache/hadoop/hdfs/server/namenode/BlockManager.java
@@ -1258,7 +1258,7 @@
// Ignore replicas already scheduled to be removed from the DN
if(belongsToInvalidates(dn.getStorageID(), block)) {
assert storedBlock.findDatanode(dn) < 0 : "Block " + block
- + " in recentInvalidatesSet should not appear in DN " + this;
+ + " in recentInvalidatesSet should not appear in DN " + dn;
return storedBlock;
}
@@ -1394,7 +1394,7 @@
throws IOException {
assert (block != null && namesystem.hasWriteLock());
BlockInfo storedBlock;
- if (block.getClass() == BlockInfoUnderConstruction.class) {
+ if (block instanceof BlockInfoUnderConstruction) {
//refresh our copy in case the block got completed in another thread
storedBlock = blocksMap.getStoredBlock(block);
} else {