Description
Calculating the size of each block and the size of the meta file requires io operation In ReplicaCachingGetSpaceUsed#refresh(). Pressure on disk performance when there are many block. HDFS-14313 is intended to reduce io operation. So get block size by ReplicaInfo and meta size by DataChecksum#getChecksumSize().
@Override protected void refresh() { if (CollectionUtils.isNotEmpty(replicaInfos)) { for (ReplicaInfo replicaInfo : replicaInfos) { if (Objects.equals(replicaInfo.getVolume().getStorageID(), volume.getStorageID())) { dfsUsed += replicaInfo.getBlockDataLength(); dfsUsed += replicaInfo.getMetadataLength(); count++; } } } }
Attachments
Attachments
Issue Links
- relates to
-
HDFS-14313 Get hdfs used space from FsDatasetImpl#volumeMap#ReplicaInfo in memory instead of df/du
- Resolved