Package org.apache.hadoop.fs.statistics
Class IOStatisticsSupport
java.lang.Object
org.apache.hadoop.fs.statistics.IOStatisticsSupport
Support for working with IOStatistics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic IOStatisticsretrieveIOStatistics(Object source) Get the IOStatistics of the source, casting it if it is of the relevant type, otherwise, if it implementsIOStatisticsSourceextracting the value.static IOStatisticsSnapshotCreate a snapshot statistics instance ready to aggregate data.static IOStatisticsSnapshotsnapshotIOStatistics(IOStatistics statistics) Take a snapshot of the current statistics state.static org.apache.hadoop.fs.statistics.DurationTrackerGet a stub duration tracker.static org.apache.hadoop.fs.statistics.DurationTrackerFactoryReturn a stub duration tracker factory whose returned trackers are always no-ops.
-
Method Details
-
snapshotIOStatistics
Take a snapshot of the current statistics state.This is not an atomic option.
The instance can be serialized, and its
toString()method lists all the values.- Parameters:
statistics- statistics- Returns:
- a snapshot of the current values.
-
snapshotIOStatistics
Create a snapshot statistics instance ready to aggregate data. The instance can be serialized, and itstoString()method lists all the values.- Returns:
- an empty snapshot
-
retrieveIOStatistics
Get the IOStatistics of the source, casting it if it is of the relevant type, otherwise, if it implementsIOStatisticsSourceextracting the value. Returns null if the source isn't of the write type or the return value ofIOStatisticsSource.getIOStatistics()was null.- Parameters:
source- source.- Returns:
- an IOStatistics instance or null
-
stubDurationTrackerFactory
public static org.apache.hadoop.fs.statistics.DurationTrackerFactory stubDurationTrackerFactory()Return a stub duration tracker factory whose returned trackers are always no-ops. As singletons are returned, this is very low-cost to use.- Returns:
- a duration tracker factory.
-
stubDurationTracker
public static org.apache.hadoop.fs.statistics.DurationTracker stubDurationTracker()Get a stub duration tracker.- Returns:
- a stub tracker.
-