StorageStatistics (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs, class: StorageStatistics

Package org.apache.hadoop.fs

# Class StorageStatistics

java.lang.Object
org.apache.hadoop.fs.StorageStatistics

@Public @Stable public abstract class StorageStatistics extends Object
StorageStatistics contains statistics data for a FileSystem or FileContext instance.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `org.apache.hadoop.fs.StorageStatistics.CommonStatisticNames`
  These are common statistic names.
  `static class`
  `org.apache.hadoop.fs.StorageStatistics.LongStatistic`
  A 64-bit storage statistic.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StorageStatistics(String name)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract Long`
  `getLong(String key)`
  Get the value of a statistic.
  `abstract Iterator<org.apache.hadoop.fs.StorageStatistics.LongStatistic>`
  `getLongStatistics()`
  Get an iterator over all the currently tracked long statistics.
  `String`
  `getName()`
  Get the name of this StorageStatistics object.
  `String`
  `getScheme()`
  `abstract boolean`
  `isTracked(String key)`
  Return true if a statistic is being tracked.
  `abstract void`
  `reset()`
  Reset all the statistic data.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### StorageStatistics

    public StorageStatistics(String name)

- ## Method Details

  - ### getName

    public String getName()
    Get the name of this StorageStatistics object.
    Returns:
      name of this StorageStatistics object

  - ### getScheme

    public String getScheme()
    Returns:
      the associated file system scheme if this is scheme specific, else return null.

  - ### getLongStatistics

    public abstract Iterator<org.apache.hadoop.fs.StorageStatistics.LongStatistic> getLongStatistics()
    Get an iterator over all the currently tracked long statistics. The values returned will depend on the type of FileSystem or FileContext object. The values do not necessarily reflect a snapshot in time.
    Returns:
      LongStatistic Iterator.

  - ### getLong

    public abstract Long getLong(String key)
    Get the value of a statistic.
    Parameters:
      `key` - key.
    Returns:
      null if the statistic is not being tracked or is not a long statistic. The value of the statistic, otherwise.

  - ### isTracked

    public abstract boolean isTracked(String key)
    Return true if a statistic is being tracked.
    Parameters:
      `key` - key.
    Returns:
      True only if the statistic is being tracked.

  - ### reset

    public abstract void reset()
    Reset all the statistic data.