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
ConstructorsConstructorDescriptionStorageStatisticsFromIOStatistics(String name, String scheme, IOStatistics ioStatistics) Instantiate. -
Method Summary
Methods inherited from class org.apache.hadoop.fs.StorageStatistics
getNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
StorageStatisticsFromIOStatistics
Instantiate.- Parameters:
name- storage statistics name.scheme- FS scheme; may be null.ioStatistics- IOStatistics source.
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<StorageStatistics.LongStatistic>
-
getLongStatistics
Take a snapshot of the current counter values and return an iterator over them.- Specified by:
getLongStatisticsin classStorageStatistics- Returns:
- all the counter statistics.
-
getLong
Description copied from class:StorageStatisticsGet the value of a statistic.- Specified by:
getLongin classStorageStatistics- 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
Description copied from class:StorageStatisticsReturn true if a statistic is being tracked.- Specified by:
isTrackedin classStorageStatistics- Parameters:
key- key.- Returns:
- True only if the statistic is being tracked.
-
reset
public void reset()Description copied from class:StorageStatisticsReset all the statistic data.- Specified by:
resetin classStorageStatistics
-
getScheme
- Overrides:
getSchemein classStorageStatistics- Returns:
- the associated file system scheme if this is scheme specific, else return null.
-