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

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

# 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 Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final StubDurationTrackerFactory`
  `STUB_DURATION_TRACKER_FACTORY`
  Single instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DurationTracker`
  `trackDuration(String key, long count)`
  Initiate a duration tracking operation by creating/returning an object whose `close()` call will update the statistics.

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

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

  ### Methods inherited from interface org.apache.hadoop.fs.statistics.DurationTrackerFactory

  `trackDuration`

- ## Field Details

  - ### STUB_DURATION_TRACKER_FACTORY

    public static final StubDurationTrackerFactory STUB_DURATION_TRACKER_FACTORY
    Single instance.

- ## 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.