HDFS-7284. Add more debug info to BlockInfoUnderConstruction#setGenerationStampAndVerifyReplicas. (Wei-Chiu Chuang via Yongjun Zhang)

This commit is contained in:
Yongjun Zhang 2015-10-26 13:16:11 -07:00
parent 3cc73773eb
commit 5e718de522
3 changed files with 18 additions and 3 deletions

View File

@ -152,11 +152,22 @@ public void setGenerationStamp(long stamp) {
generationStamp = stamp;
}
/**
* 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) {

View File

@ -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

View File

@ -393,8 +393,8 @@ public void setGenerationStampAndVerifyReplicas(long genStamp) {
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));
}
}