HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing unnecessary io operations. Contributed by Lisheng Sun.
(cherry picked from commit cb4daeaad95470125c59ccb80b988261ae83d534)
(cherry picked from commit f9437b1817
)
This commit is contained in:
parent
d318b48e12
commit
268e35d3ae
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue