FSDatasetMBean (Apache Hadoop HDFS 3.5.0 API)
Description: declaration: package: org.apache.hadoop.hdfs.server.datanode.metrics, interface: FSDatasetMBean

Package org.apache.hadoop.hdfs.server.datanode.metrics

# Interface FSDatasetMBean

All Superinterfaces:
  `org.apache.hadoop.metrics2.MetricsSource`

All Known Subinterfaces:
  `FsDatasetSpi<V>`

@Private public interface FSDatasetMBean extends org.apache.hadoop.metrics2.MetricsSource
This Interface defines the methods to get the status of a the FSDataset of a data node. It is also used for publishing via JMX (hence we follow the JMX naming convention.) * Note we have not used the MetricsDynamicMBeanBase to implement this because the interface for the FSDatasetMBean is stable and should be published as an interface.

Data Node runtime statistic info is report in another MBean

See Also:
  - `DataNodeMetrics`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getBlockPoolUsed(String bpid)`
  Returns the total space (in bytes) used by a block pool
  `long`
  `getCacheCapacity()`
  Returns the total cache capacity of the datanode (in bytes).
  `long`
  `getCacheUsed()`
  Returns the amount of cache used by the datanode (in bytes).
  `long`
  `getCapacity()`
  Returns total capacity (in bytes) of storage (used and unused)
  `long`
  `getDfsUsed()`
  Returns the total space (in bytes) used by dfs datanode
  `long`
  `getEstimatedCapacityLostTotal()`
  Returns an estimate of total capacity lost due to volume failures in bytes.
  `String[]`
  `getFailedStorageLocations()`
  Returns each storage location that has failed, sorted.
  `long`
  `getLastDirScannerFinishTime()`
  Returns the last time in milliseconds when the directory scanner successfully ran.
  `long`
  `getLastVolumeFailureDate()`
  Returns the date/time of the last volume failure in milliseconds since epoch.
  `long`
  `getNumBlocksCached()`
  Returns the number of blocks cached.
  `long`
  `getNumBlocksFailedToCache()`
  Returns the number of blocks that the datanode was unable to cache
  `long`
  `getNumBlocksFailedToUncache()`
  Returns the number of blocks that the datanode was unable to uncache
  `int`
  `getNumFailedVolumes()`
  Returns the number of failed volumes in the datanode.
  `long`
  `getPendingAsyncDeletions()`
  Returns the count of pending and running asynchronous disk operations.
  `long`
  `getRemaining()`
  Returns the amount of free storage space (in bytes)
  `String`
  `getStorageInfo()`
  Returns the storage id of the underlying storage

  ### Methods inherited from interface org.apache.hadoop.metrics2.MetricsSource

  `getMetrics`

- ## Method Details

  - ### getBlockPoolUsed

    long getBlockPoolUsed(String bpid) throws IOException
    Returns the total space (in bytes) used by a block pool
    Returns:
      the total space used by a block pool
    Throws:
      `IOException`

  - ### getDfsUsed

    long getDfsUsed() throws IOException
    Returns the total space (in bytes) used by dfs datanode
    Returns:
      the total space used by dfs datanode
    Throws:
      `IOException`

  - ### getCapacity

    long getCapacity() throws IOException
    Returns total capacity (in bytes) of storage (used and unused)
    Returns:
      total capacity of storage (used and unused)
    Throws:
      `IOException`

  - ### getRemaining

    long getRemaining() throws IOException
    Returns the amount of free storage space (in bytes)
    Returns:
      The amount of free storage space
    Throws:
      `IOException`

  - ### getStorageInfo

    String getStorageInfo()
    Returns the storage id of the underlying storage

  - ### getNumFailedVolumes

    int getNumFailedVolumes()
    Returns the number of failed volumes in the datanode.
    Returns:
      The number of failed volumes in the datanode.

  - ### getFailedStorageLocations

    String[] getFailedStorageLocations()
    Returns each storage location that has failed, sorted.
    Returns:
      each storage location that has failed, sorted

  - ### getLastVolumeFailureDate

    long getLastVolumeFailureDate()
    Returns the date/time of the last volume failure in milliseconds since epoch.
    Returns:
      date/time of last volume failure in milliseconds since epoch

  - ### getEstimatedCapacityLostTotal

    long getEstimatedCapacityLostTotal()
    Returns an estimate of total capacity lost due to volume failures in bytes.
    Returns:
      estimate of total capacity lost in bytes

  - ### getCacheUsed

    long getCacheUsed()
    Returns the amount of cache used by the datanode (in bytes).

  - ### getCacheCapacity

    long getCacheCapacity()
    Returns the total cache capacity of the datanode (in bytes).

  - ### getNumBlocksCached

    long getNumBlocksCached()
    Returns the number of blocks cached.

  - ### getNumBlocksFailedToCache

    long getNumBlocksFailedToCache()
    Returns the number of blocks that the datanode was unable to cache

  - ### getNumBlocksFailedToUncache

    long getNumBlocksFailedToUncache()
    Returns the number of blocks that the datanode was unable to uncache

  - ### getLastDirScannerFinishTime

    long getLastDirScannerFinishTime()
    Returns the last time in milliseconds when the directory scanner successfully ran.

  - ### getPendingAsyncDeletions

    long getPendingAsyncDeletions()
    Returns the count of pending and running asynchronous disk operations.