Class DynamicIOStatisticsBuilder
java.lang.Object
org.apache.hadoop.fs.statistics.impl.DynamicIOStatisticsBuilder
Builder of
DynamicIOStatistics.
Instantiate through
IOStatisticsBinding.dynamicIOStatistics().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the IOStatistics instance.withAtomicIntegerCounter(String key, AtomicInteger source) Add a counter statistic to dynamically return the latest value of the source.withAtomicIntegerGauge(String key, AtomicInteger source) Add a gauge statistic to dynamically return the latest value of the source.withAtomicIntegerMaximum(String key, AtomicInteger source) Add a maximum statistic to dynamically return the latest value of the source.withAtomicIntegerMinimum(String key, AtomicInteger source) Add a minimum statistic to dynamically return the latest value of the source.withAtomicLongCounter(String key, AtomicLong source) Add a counter statistic to dynamically return the latest value of the source.withAtomicLongGauge(String key, AtomicLong source) Add a gauge statistic to dynamically return the latest value of the source.withAtomicLongMaximum(String key, AtomicLong source) Add a maximum statistic to dynamically return the latest value of the source.withAtomicLongMinimum(String key, AtomicLong source) Add a minimum statistic to dynamically return the latest value of the source.withLongFunctionCounter(String key, ToLongFunction<String> eval) Add a new evaluator to the counter statistics.withLongFunctionGauge(String key, ToLongFunction<String> eval) Add a new evaluator to the gauge statistics.withLongFunctionMaximum(String key, ToLongFunction<String> eval) Add a new evaluator to the maximum statistics.withLongFunctionMinimum(String key, ToLongFunction<String> eval) Add a new evaluator to the minimum statistics.withMeanStatisticFunction(String key, Function<String, MeanStatistic> eval) Add a new evaluator to the mean statistics.withMutableCounter(String key, MutableCounterLong source) Build a dynamic counter statistic from aMutableCounterLong.
-
Constructor Details
-
DynamicIOStatisticsBuilder
public DynamicIOStatisticsBuilder()
-
-
Method Details
-
build
Build the IOStatistics instance.- Returns:
- an instance.
- Throws:
IllegalStateException- if the builder has already been built.
-
withLongFunctionCounter
Add a new evaluator to the counter statistics.- Parameters:
key- key of this statisticeval- evaluator for the statistic- Returns:
- the builder.
-
withAtomicLongCounter
Add a counter statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic long counter- Returns:
- the builder.
-
withAtomicIntegerCounter
Add a counter statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic int counter- Returns:
- the builder.
-
withMutableCounter
Build a dynamic counter statistic from aMutableCounterLong.- Parameters:
key- key of this statisticsource- mutable long counter- Returns:
- the builder.
-
withLongFunctionGauge
Add a new evaluator to the gauge statistics.- Parameters:
key- key of this statisticeval- evaluator for the statistic- Returns:
- the builder.
-
withAtomicLongGauge
Add a gauge statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic long gauge- Returns:
- the builder.
-
withAtomicIntegerGauge
Add a gauge statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic int gauge- Returns:
- the builder.
-
withLongFunctionMinimum
Add a new evaluator to the minimum statistics.- Parameters:
key- key of this statisticeval- evaluator for the statistic- Returns:
- the builder.
-
withAtomicLongMinimum
Add a minimum statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic long minimum- Returns:
- the builder.
-
withAtomicIntegerMinimum
Add a minimum statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic int minimum- Returns:
- the builder.
-
withLongFunctionMaximum
Add a new evaluator to the maximum statistics.- Parameters:
key- key of this statisticeval- evaluator for the statistic- Returns:
- the builder.
-
withAtomicLongMaximum
Add a maximum statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic long maximum- Returns:
- the builder.
-
withAtomicIntegerMaximum
Add a maximum statistic to dynamically return the latest value of the source.- Parameters:
key- key of this statisticsource- atomic int maximum- Returns:
- the builder.
-
withMeanStatisticFunction
public DynamicIOStatisticsBuilder withMeanStatisticFunction(String key, Function<String, MeanStatistic> eval) Add a new evaluator to the mean statistics. This is a function which must return the mean and the sample count.- Parameters:
key- key of this statisticeval- evaluator for the statistic- Returns:
- the builder.
-