HDFS-6578. add toString method to DatanodeStorage for easier debugging. (Contributed by Yongjun Zhang)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1604942 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-06-23 21:30:02 +00:00
parent 9ddedbf3df
commit 5ac06c8b38
4 changed files with 14 additions and 0 deletions

View File

@ -464,6 +464,9 @@ Release 2.5.0 - UNRELEASED
HDFS-6507. Improve DFSAdmin to support HA cluster better.
(Zesheng Wu via vinayakumarb)
HDFS-6578. add toString method to DatanodeStorage for easier debugging.
(Yongjun Zhang via Arpit Agarwal)
OPTIMIZATIONS
HDFS-6214. Webhdfs has poor throughput for files >2GB (daryn)

View File

@ -1749,6 +1749,7 @@ public boolean processReport(final DatanodeID nodeID,
}
blockLog.info("BLOCK* processReport: from storage " + storage.getStorageID()
+ " node " + nodeID + ", blocks: " + newReport.getNumberOfBlocks()
+ ", hasStaleStorages: " + node.hasStaleStorages()
+ ", processing time: " + (endTime - startTime) + " msecs");
return !node.hasStaleStorages();
}

View File

@ -1046,6 +1046,11 @@ public DatanodeCommand blockReport(DatanodeRegistration nodeReg,
boolean noStaleStorages = false;
for(StorageBlockReport r : reports) {
final BlockListAsLongs blocks = new BlockListAsLongs(r.getBlocks());
//
// BlockManager.processReport accumulates information of prior calls
// for the same node and storage, so the value returned by the last
// call of this loop is the final updated value for noStaleStorage.
//
noStaleStorages = bm.processReport(nodeReg, r.getStorage(), poolId, blocks);
metrics.incrStorageBlockReportOps();
}

View File

@ -81,6 +81,11 @@ public static String generateUuid() {
return "DS-" + UUID.randomUUID();
}
@Override
public String toString() {
return "DatanodeStorage["+ storageID + "," + storageType + "," + state +"]";
}
@Override
public boolean equals(Object other){
if (other == this) {