This is an automated email from the ASF dual-hosted git repository.
weichiu pushed a commit to branch branch-3.2
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/branch-3.2 by this push:
new f9437b1 HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing
unnecessary io operations. Contributed by Lisheng Sun.
f9437b1 is described below
commit f9437b1817e09c5a3ee7b378a0f4faee9b853315
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)
---
.../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]