This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 268e35d  HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing 
unnecessary io operations. Contributed by Lisheng Sun.
268e35d is described below

commit 268e35d3ae75f901c47ac5c5e115ca7c039b3a61
Author: Wei-Chiu Chuang <[email protected]>
AuthorDate: Mon Feb 24 13:37:11 2020 -0800

    HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing unnecessary io 
operations. Contributed by Lisheng Sun.
    
    (cherry picked from commit cb4daeaad95470125c59ccb80b988261ae83d534)
    (cherry picked from commit f9437b1817e09c5a3ee7b378a0f4faee9b853315)
---
 .../hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java
 
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java
index 477e050..2c1c16e 100644
--- 
a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/ReplicaCachingGetSpaceUsed.java
+++ 
b/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++;
           }


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

Reply via email to