Class StubDurationTrackerFactory

java.lang.Object
org.apache.hadoop.fs.statistics.impl.StubDurationTrackerFactory
All Implemented Interfaces:
DurationTrackerFactory

public final class StubDurationTrackerFactory extends Object implements DurationTrackerFactory
This is a stub factory which always returns no-op duration trackers. Allows for code to always be handed a factory.
  • Field Details

  • Method Details

    • trackDuration

      public DurationTracker trackDuration(String key, long count)
      Description copied from interface: DurationTrackerFactory
      Initiate a duration tracking operation by creating/returning an object whose close() call will update the statistics. The statistics counter with the key name will be incremented by the given count. The expected use is within a try-with-resources clause. The default implementation returns a stub duration tracker.
      Specified by:
      trackDuration in interface DurationTrackerFactory
      Parameters:
      key - statistic key prefix
      count - #of times to increment the matching counter in this operation.
      Returns:
      an object to close after an operation completes.