MutableMetricsFactory (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.metrics2.lib, class: MutableMetricsFactory

Package org.apache.hadoop.metrics2.lib

# Class MutableMetricsFactory

java.lang.Object
org.apache.hadoop.metrics2.lib.MutableMetricsFactory

@Private @Evolving public class MutableMetricsFactory extends Object

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MutableMetricsFactory()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected MetricsInfo`
  `getInfo(Class<?> cls, Metrics annotation)`
  `protected MetricsInfo`
  `getInfo(Metric annotation, Field field)`
  `protected MetricsInfo`
  `getInfo(Metric annotation, Method method)`
  `protected MetricsInfo`
  `getInfo(Metric annotation, String defaultName)`
  `protected String`
  `getName(Field field)`
  `protected String`
  `getName(Method method)`
  `protected MutableMetric`
  `newForField(Field field, Metric annotation)`
  Override to handle custom mutable metrics for fields
  `protected MutableMetric`
  `newForMethod(Object source, Method method, Metric annotation)`
  Override to handle custom mutable metrics for methods

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

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

- ## Constructor Details

  - ### MutableMetricsFactory

    public MutableMetricsFactory()

- ## Method Details

  - ### newForField

    protected MutableMetric newForField(Field field, Metric annotation)
    Override to handle custom mutable metrics for fields
    Parameters:
      `field` - of the metric
      `annotation` - of the field
    Returns:
      a new metric object or null

  - ### newForMethod

    protected MutableMetric newForMethod(Object source, Method method, Metric annotation)
    Override to handle custom mutable metrics for methods
    Parameters:
      `source` - the metrics source object
      `method` - to return the metric
      `annotation` - of the method
    Returns:
      a new metric object or null

  - ### getInfo

    protected MetricsInfo getInfo(Metric annotation, Field field)

  - ### getName

    protected String getName(Field field)

  - ### getInfo

    protected MetricsInfo getInfo(Metric annotation, Method method)

  - ### getInfo

    protected MetricsInfo getInfo(Class<?> cls, Metrics annotation)

  - ### getName

    protected String getName(Method method)
    Parameters:
      `method` - input method.
    Returns:
      Remove the prefix "get", if any, from the method name. Return the capacitalized method name."

  - ### getInfo

    protected MetricsInfo getInfo(Metric annotation, String defaultName)