liubingxing commented on a change in pull request #3714:
URL: https://github.com/apache/hadoop/pull/3714#discussion_r767112952



##########
File path: 
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/DatanodeManager.java
##########
@@ -2172,8 +2172,9 @@ public String getSlowDisksReport() {
         .size()];
     for (int i = 0; i < reports.length; i++) {
       final DatanodeDescriptor d = datanodes.get(i);
-      reports[i] = new DatanodeStorageReport(
-          new DatanodeInfoBuilder().setFrom(d).build(), d.getStorageReports());
+      DatanodeInfo dnInfo = new DatanodeInfoBuilder().setFrom(d).build();
+      dnInfo.setNumBlocks(d.numBlocks());

Review comment:
       @Hexiaoqiao `new DatanodeInfoBuilder().setFrom(d).build()` set the 
`DatanodeInfo` from `DatanodeDescriptor` which from `final 
List<DatanodeDescriptor> datanodes = getDatanodeListForReport(type); `. But 
`DatanodeDescriptor` does not set the actual numBlocks of datanode.
   
   `datanodeReport` set the numBlocks like this.
   
![image](https://user-images.githubusercontent.com/2844826/145671042-dfae2aae-9c9a-4d0b-940a-7a1fea16a79d.png)
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to