Class StubDurationTrackerFactory
java.lang.Object
org.apache.hadoop.fs.statistics.impl.StubDurationTrackerFactory
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptiontrackDuration(String key, long count) Initiate a duration tracking operation by creating/returning an object whoseclose()call will update the statistics.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.fs.statistics.DurationTrackerFactory
trackDuration
-
Field Details
-
STUB_DURATION_TRACKER_FACTORY
Single instance.
-
-
Method Details
-
trackDuration
Description copied from interface:DurationTrackerFactoryInitiate a duration tracking operation by creating/returning an object whoseclose()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:
trackDurationin interfaceDurationTrackerFactory- Parameters:
key- statistic key prefixcount- #of times to increment the matching counter in this operation.- Returns:
- an object to close after an operation completes.
-