Explorar el Código

HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing unnecessary io operations. Contributed by Lisheng Sun.

(cherry picked from commit cb4daeaad95470125c59ccb80b988261ae83d534)
(cherry picked from commit f9437b1817e09c5a3ee7b378a0f4faee9b853315)
Wei-Chiu Chuang hace 5 años
padre
commit
268e35d3ae

+ 1 - 1
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java

@@ -85,7 +85,7 @@ public class ReplicaCachingGetSpaceUsed extends FSCachingGetSpaceUsed {
         for (ReplicaInfo replicaInfo : replicaInfos) {
           if (Objects.equals(replicaInfo.getVolume().getStorageID(),
               volume.getStorageID())) {
-            dfsUsed += replicaInfo.getBlockDataLength();
+            dfsUsed += replicaInfo.getBytesOnDisk();
             dfsUsed += replicaInfo.getMetadataLength();
             count++;
           }