Class ReplicaCachingGetSpaceUsed

java.lang.Object
org.apache.hadoop.fs.CachingGetSpaceUsed
org.apache.hadoop.hdfs.server.datanode.FSCachingGetSpaceUsed
org.apache.hadoop.hdfs.server.datanode.fsdataset.impl.ReplicaCachingGetSpaceUsed
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.hadoop.fs.GetSpaceUsed

@Private @Evolving public class ReplicaCachingGetSpaceUsed extends FSCachingGetSpaceUsed
Fast and accurate class to tell how much space HDFS is using. This class gets hdfs used space from FsDatasetImpl#volumeMap#ReplicaInfos that uses an in memory way. Getting hdfs used space by ReplicaCachingGetSpaceUsed impl only includes block and meta files, but DU impl is blockpool dir based statistics that will include additional files, e.g. tmp dir, scanner.cursor file. Getting space used by DU impl will be greater than by ReplicaCachingGetSpaceUsed impl, but the latter is more accurate. Setting fs.getspaceused.classname to org.apache.hadoop.hdfs.server.datanode.fsdataset impl.ReplicaCachingGetSpaceUsed in your core-site.xml if we want to enable.
  • Constructor Details

  • Method Details

    • refresh

      protected void refresh()
      Specified by:
      refresh in class org.apache.hadoop.fs.CachingGetSpaceUsed