Class IOStatisticsSupport

java.lang.Object
org.apache.hadoop.fs.statistics.IOStatisticsSupport

@Public @Unstable public final class IOStatisticsSupport extends Object
Support for working with IOStatistics.
  • Method Details

    • snapshotIOStatistics

      public static IOStatisticsSnapshot snapshotIOStatistics(IOStatistics statistics)
      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

      public static IOStatisticsSnapshot snapshotIOStatistics()
      Create a snapshot statistics instance ready to aggregate data. The instance can be serialized, and its toString() method lists all the values.
      Returns:
      an empty snapshot
    • retrieveIOStatistics

      public static IOStatistics retrieveIOStatistics(Object source)
      Get the IOStatistics of the source, casting it if it is of the relevant type, otherwise, if it implements IOStatisticsSource extracting the value. Returns null if the source isn't of the write type or the return value of IOStatisticsSource.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.