You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2021/12/13 12:06:01 UTC

[GitHub] [hadoop] liubingxing commented on a change in pull request #3714: HDFS-16352. return the real datanode numBlocks in #getDatanodeStorage…

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: common-issues-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org