Class ForwardingIOStatisticsStore
java.lang.Object
org.apache.hadoop.fs.statistics.impl.ForwardingIOStatisticsStore
- All Implemented Interfaces:
DurationTrackerFactory,IOStatisticsStore,IOStatistics,IOStatisticsAggregator,IOStatisticsSetters
This may seem odd having an IOStatisticsStore which does nothing
but forward to a wrapped store, but it's designed to
assist in subclassing of selective methods, such
as those to increment counters, get durations etc.
-
Field Summary
Fields inherited from interface org.apache.hadoop.fs.statistics.IOStatistics
MAX_UNSET_VALUE, MIN_UNSET_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMaximumSample(String key, long value) Add a maximum sample: if greater than the current value, updates the value.voidaddMeanStatisticSample(String key, long value) Add a sample to the mean statistics.voidaddMinimumSample(String key, long value) Add a minimum sample: if less than the current value, updates the value.voidaddTimedOperation(String prefix, long durationMillis) Add a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value.voidaddTimedOperation(String prefix, Duration duration) Add a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value.; increment tha counter whose name == prefix.booleanaggregate(IOStatistics statistics) Aggregate the supplied statistics into the current set.counters()Map of counters.gauges()Map of gauges.Get a reference to the atomic instance providing the value for a specific counter.getGaugeReference(String key) Get a reference to the atomic instance providing the value for a specific gauge.protected IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific maximum.getMeanStatistic(String key) Get a reference to the atomic instance providing the value for a specific meanStatistic.Get a reference to the atomic instance providing the value for a specific minimum.longincrementCounter(String key, long value) Increment a counter.longincrementGauge(String key, long value) Increment a gauge.longincrementMaximum(String key, long value) Increment a maximum.longincrementMinimum(String key, long value) Increment a minimum.maximums()Map of maximums.Map of meanStatistics.minimums()Map of minimums.voidreset()Reset all statistics.voidsetCounter(String key, long value) Set a counter.voidSet a gauge.voidsetMaximum(String key, long value) Set a maximum.voidsetMeanStatistic(String key, MeanStatistic value) Set a mean statistic to a given value.voidsetMinimum(String key, long value) Set a minimum.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, trackDurationMethods inherited from interface org.apache.hadoop.fs.statistics.impl.IOStatisticsStore
addSample, incrementCounter
-
Constructor Details
-
ForwardingIOStatisticsStore
-
-
Method Details
-
getInnerStatistics
-
counters
Description copied from interface:IOStatisticsMap of counters.- Specified by:
countersin interfaceIOStatistics- Returns:
- the current map of counters.
-
gauges
Description copied from interface:IOStatisticsMap of gauges.- Specified by:
gaugesin interfaceIOStatistics- Returns:
- the current map of gauges.
-
minimums
Description copied from interface:IOStatisticsMap of minimums.- Specified by:
minimumsin interfaceIOStatistics- Returns:
- the current map of minimums.
-
maximums
Description copied from interface:IOStatisticsMap of maximums.- Specified by:
maximumsin interfaceIOStatistics- Returns:
- the current map of maximums.
-
meanStatistics
Description copied from interface:IOStatisticsMap of meanStatistics.- Specified by:
meanStatisticsin interfaceIOStatistics- Returns:
- the current map of MeanStatistic statistics.
-
aggregate
Description copied from interface:IOStatisticsAggregatorAggregate the supplied statistics into the current set.- Specified by:
aggregatein interfaceIOStatisticsAggregator- Parameters:
statistics- statistics; may be null- Returns:
- true if the statistics reference was not null and so aggregated.
-
incrementCounter
Description copied from interface:IOStatisticsStoreIncrement a counter. No-op if the counter is unknown. If the value is negative, it is ignored.- Specified by:
incrementCounterin interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- value to increment- Returns:
- the updated value or, if the counter is unknown: 0
-
setCounter
Description copied from interface:IOStatisticsSettersSet a counter. No-op if the counter is unknown.- Specified by:
setCounterin interfaceIOStatisticsSetters- Parameters:
key- statistics keyvalue- value to set
-
setGauge
Description copied from interface:IOStatisticsSettersSet a gauge.- Specified by:
setGaugein interfaceIOStatisticsSetters- Parameters:
key- statistics keyvalue- value to set
-
incrementGauge
Description copied from interface:IOStatisticsStoreIncrement a gauge.No-op if the gauge is unknown.
- Specified by:
incrementGaugein interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- value to increment- Returns:
- new value or 0 if the key is unknown
-
setMaximum
Description copied from interface:IOStatisticsSettersSet a maximum.- Specified by:
setMaximumin interfaceIOStatisticsSetters- Parameters:
key- statistics keyvalue- value to set
-
incrementMaximum
Description copied from interface:IOStatisticsStoreIncrement a maximum.No-op if the maximum is unknown.
- Specified by:
incrementMaximumin interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- value to increment- Returns:
- new value or 0 if the key is unknown
-
setMinimum
Description copied from interface:IOStatisticsSettersSet a minimum.- Specified by:
setMinimumin interfaceIOStatisticsSetters- Parameters:
key- statistics keyvalue- value to set
-
incrementMinimum
Description copied from interface:IOStatisticsStoreIncrement a minimum.No-op if the minimum is unknown.
- Specified by:
incrementMinimumin interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- value to increment- Returns:
- new value or 0 if the key is unknown
-
addMinimumSample
Description copied from interface:IOStatisticsStoreAdd a minimum sample: if less than the current value, updates the value.No-op if the minimum is unknown.
- Specified by:
addMinimumSamplein interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- sample value
-
addMaximumSample
Description copied from interface:IOStatisticsStoreAdd a maximum sample: if greater than the current value, updates the value.No-op if the key is unknown.
- Specified by:
addMaximumSamplein interfaceIOStatisticsStore- Parameters:
key- statistics keyvalue- sample value
-
setMeanStatistic
Description copied from interface:IOStatisticsSettersSet a mean statistic to a given value.- Specified by:
setMeanStatisticin interfaceIOStatisticsSetters- Parameters:
key- statistic keyvalue- new value.
-
addMeanStatisticSample
Description copied from interface:IOStatisticsStoreAdd a sample to the mean statistics.No-op if the key is unknown.
- Specified by:
addMeanStatisticSamplein interfaceIOStatisticsStore- Parameters:
key- keyvalue- sample value.
-
reset
public void reset()Description copied from interface:IOStatisticsStoreReset all statistics. Unsynchronized.- Specified by:
resetin interfaceIOStatisticsStore
-
getCounterReference
Description copied from interface:IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific counter. This is useful if the value is passed around.- Specified by:
getCounterReferencein interfaceIOStatisticsStore- Parameters:
key- statistic name- Returns:
- the reference
-
getMaximumReference
Description copied from interface:IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific maximum. This is useful if the value is passed around.- Specified by:
getMaximumReferencein interfaceIOStatisticsStore- Parameters:
key- statistic name- Returns:
- the reference
-
getMinimumReference
Description copied from interface:IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific minimum. This is useful if the value is passed around.- Specified by:
getMinimumReferencein interfaceIOStatisticsStore- Parameters:
key- statistic name- Returns:
- the reference
-
getGaugeReference
Description copied from interface:IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific gauge. This is useful if the value is passed around.- Specified by:
getGaugeReferencein interfaceIOStatisticsStore- Parameters:
key- statistic name- Returns:
- the reference
-
getMeanStatistic
Description copied from interface:IOStatisticsStoreGet a reference to the atomic instance providing the value for a specific meanStatistic. This is useful if the value is passed around.- Specified by:
getMeanStatisticin interfaceIOStatisticsStore- Parameters:
key- statistic name- Returns:
- the reference
-
addTimedOperation
Description copied from interface:IOStatisticsStoreAdd a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value. The update is not-atomic, even though each individual statistic is updated thread-safely. If two threads update the values simultaneously, at the end of each operation the state will be correct. It is only during the sequence that the statistics may be observably inconsistent.- Specified by:
addTimedOperationin interfaceIOStatisticsStore- Parameters:
prefix- statistic prefixdurationMillis- duration in milliseconds.
-
addTimedOperation
Description copied from interface:IOStatisticsStoreAdd a duration to the min/mean/max statistics, using the given prefix and adding a suffix for each specific value.; increment tha counter whose name == prefix. If any of the statistics are not registered, that part of the sequence will be omitted -the rest will proceed. The update is not-atomic, even though each individual statistic is updated thread-safely. If two threads update the values simultaneously, at the end of each operation the state will be correct. It is only during the sequence that the statistics may be observably inconsistent.- Specified by:
addTimedOperationin interfaceIOStatisticsStore- Parameters:
prefix- statistic prefixduration- duration
-