- All Implemented Interfaces:
java.io.Closeable, java.lang.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.