Class DynamicIOStatisticsBuilder

java.lang.Object
org.apache.hadoop.fs.statistics.impl.DynamicIOStatisticsBuilder

public class DynamicIOStatisticsBuilder extends Object
Builder of DynamicIOStatistics. Instantiate through IOStatisticsBinding.dynamicIOStatistics().
  • Constructor Details

    • DynamicIOStatisticsBuilder

      public DynamicIOStatisticsBuilder()
  • Method Details

    • build

      public IOStatistics build()
      Build the IOStatistics instance.
      Returns:
      an instance.
      Throws:
      IllegalStateException - if the builder has already been built.
    • withLongFunctionCounter

      public DynamicIOStatisticsBuilder withLongFunctionCounter(String key, ToLongFunction<String> eval)
      Add a new evaluator to the counter statistics.
      Parameters:
      key - key of this statistic
      eval - evaluator for the statistic
      Returns:
      the builder.
    • withAtomicLongCounter

      public DynamicIOStatisticsBuilder withAtomicLongCounter(String key, AtomicLong source)
      Add a counter statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic long counter
      Returns:
      the builder.
    • withAtomicIntegerCounter

      public DynamicIOStatisticsBuilder withAtomicIntegerCounter(String key, AtomicInteger source)
      Add a counter statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic int counter
      Returns:
      the builder.
    • withMutableCounter

      public DynamicIOStatisticsBuilder withMutableCounter(String key, MutableCounterLong source)
      Build a dynamic counter statistic from a MutableCounterLong.
      Parameters:
      key - key of this statistic
      source - mutable long counter
      Returns:
      the builder.
    • withLongFunctionGauge

      public DynamicIOStatisticsBuilder withLongFunctionGauge(String key, ToLongFunction<String> eval)
      Add a new evaluator to the gauge statistics.
      Parameters:
      key - key of this statistic
      eval - evaluator for the statistic
      Returns:
      the builder.
    • withAtomicLongGauge

      public DynamicIOStatisticsBuilder withAtomicLongGauge(String key, AtomicLong source)
      Add a gauge statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic long gauge
      Returns:
      the builder.
    • withAtomicIntegerGauge

      public DynamicIOStatisticsBuilder withAtomicIntegerGauge(String key, AtomicInteger source)
      Add a gauge statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic int gauge
      Returns:
      the builder.
    • withLongFunctionMinimum

      public DynamicIOStatisticsBuilder withLongFunctionMinimum(String key, ToLongFunction<String> eval)
      Add a new evaluator to the minimum statistics.
      Parameters:
      key - key of this statistic
      eval - evaluator for the statistic
      Returns:
      the builder.
    • withAtomicLongMinimum

      public DynamicIOStatisticsBuilder withAtomicLongMinimum(String key, AtomicLong source)
      Add a minimum statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic long minimum
      Returns:
      the builder.
    • withAtomicIntegerMinimum

      public DynamicIOStatisticsBuilder withAtomicIntegerMinimum(String key, AtomicInteger source)
      Add a minimum statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic int minimum
      Returns:
      the builder.
    • withLongFunctionMaximum

      public DynamicIOStatisticsBuilder withLongFunctionMaximum(String key, ToLongFunction<String> eval)
      Add a new evaluator to the maximum statistics.
      Parameters:
      key - key of this statistic
      eval - evaluator for the statistic
      Returns:
      the builder.
    • withAtomicLongMaximum

      public DynamicIOStatisticsBuilder withAtomicLongMaximum(String key, AtomicLong source)
      Add a maximum statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - atomic long maximum
      Returns:
      the builder.
    • withAtomicIntegerMaximum

      public DynamicIOStatisticsBuilder withAtomicIntegerMaximum(String key, AtomicInteger source)
      Add a maximum statistic to dynamically return the latest value of the source.
      Parameters:
      key - key of this statistic
      source - 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 statistic
      eval - evaluator for the statistic
      Returns:
      the builder.