HDFS-15174. Optimize ReplicaCachingGetSpaceUsed by reducing unnecessary io operations. Contributed by Lisheng Sun.
This commit is contained in:
parent
72fa9c7f1b
commit
1c5d2f1fdc
|
@ -86,7 +86,7 @@ public class ReplicaCachingGetSpaceUsed extends FSCachingGetSpaceUsed {
|
||||||
for (ReplicaInfo replicaInfo : replicaInfos) {
|
for (ReplicaInfo replicaInfo : replicaInfos) {
|
||||||
if (Objects.equals(replicaInfo.getVolume().getStorageID(),
|
if (Objects.equals(replicaInfo.getVolume().getStorageID(),
|
||||||
volume.getStorageID())) {
|
volume.getStorageID())) {
|
||||||
dfsUsed += replicaInfo.getBlockDataLength();
|
dfsUsed += replicaInfo.getBytesOnDisk();
|
||||||
dfsUsed += replicaInfo.getMetadataLength();
|
dfsUsed += replicaInfo.getMetadataLength();
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue