HDFS-6578: Merging r1604942 from trunk to branch-2.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1604943 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Arpit Agarwal 2014-06-23 21:31:24 +00:00
parent dd90472574
commit fccacfb212
4 changed files with 14 additions and 0 deletions

View File

@ -210,6 +210,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

@ -1752,6 +1752,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

@ -1041,6 +1041,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) {