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
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hdfs.server.datanode.FSCachingGetSpaceUsed
FSCachingGetSpaceUsed.Builder -
Field Summary
Fields inherited from class org.apache.hadoop.fs.CachingGetSpaceUsed
used -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.apache.hadoop.fs.CachingGetSpaceUsed
close, getDirPath, getJitter, getRefreshInterval, getUsed, incDfsUsed, setShouldFirstRefresh, setUsed
-
Constructor Details
-
ReplicaCachingGetSpaceUsed
- Throws:
IOException
-
-
Method Details
-
refresh
protected void refresh()- Specified by:
refreshin classorg.apache.hadoop.fs.CachingGetSpaceUsed
-