StorageStatisticsFromIOStatistics (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.fs.statistics.impl, class: StorageStatisticsFromIOStatistics

Package org.apache.hadoop.fs.statistics.impl

# Class StorageStatisticsFromIOStatistics

java.lang.Object
org.apache.hadoop.fs.StorageStatistics
org.apache.hadoop.fs.statistics.impl.StorageStatisticsFromIOStatistics

All Implemented Interfaces:
  `Iterable<StorageStatistics.LongStatistic>`

public class StorageStatisticsFromIOStatistics extends StorageStatistics implements Iterable<StorageStatistics.LongStatistic>
Returns all the counters of an IOStatistics instance as StorageStatistics. This is dynamic. The `reset()` is downgraded to a no-op.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.hadoop.fs.StorageStatistics

  `StorageStatistics.CommonStatisticNames, StorageStatistics.LongStatistic`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `StorageStatisticsFromIOStatistics(String name, String scheme, IOStatistics ioStatistics)`
  Instantiate.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Long`
  `getLong(String key)`
  Get the value of a statistic.
  `Iterator<StorageStatistics.LongStatistic>`
  `getLongStatistics()`
  Take a snapshot of the current counter values and return an iterator over them.
  `String`
  `getScheme()`
  `boolean`
  `isTracked(String key)`
  Return true if a statistic is being tracked.
  `Iterator<StorageStatistics.LongStatistic>`
  `iterator()`
  `void`
  `reset()`
  Reset all the statistic data.

  ### Methods inherited from class org.apache.hadoop.fs.StorageStatistics

  `getName`

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

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

  ### Methods inherited from interface java.lang.Iterable

  `forEach, spliterator`

- ## Constructor Details

  - ### StorageStatisticsFromIOStatistics

    public StorageStatisticsFromIOStatistics(String name, String scheme, IOStatistics ioStatistics)
    Instantiate.
    Parameters:
      `name` - storage statistics name.
      `scheme` - FS scheme; may be null.
      `ioStatistics` - IOStatistics source.

- ## Method Details

  - ### iterator

    public Iterator<StorageStatistics.LongStatistic> iterator()
    Specified by:
      `iterator` in interface `Iterable<StorageStatistics.LongStatistic>`

  - ### getLongStatistics

    public Iterator<StorageStatistics.LongStatistic> getLongStatistics()
    Take a snapshot of the current counter values and return an iterator over them.
    Specified by:
      `getLongStatistics` in class `StorageStatistics`
    Returns:
      all the counter statistics.

  - ### getLong

    public Long getLong(String key)
    Description copied from class: `StorageStatistics`
    Get the value of a statistic.
    Specified by:
      `getLong` in class `StorageStatistics`
    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 boolean isTracked(String key)
    Description copied from class: `StorageStatistics`
    Return true if a statistic is being tracked.
    Specified by:
      `isTracked` in class `StorageStatistics`
    Parameters:
      `key` - key.
    Returns:
      True only if the statistic is being tracked.

  - ### reset

    public void reset()
    Description copied from class: `StorageStatistics`
    Reset all the statistic data.
    Specified by:
      `reset` in class `StorageStatistics`

  - ### getScheme

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