CustomResourceMetrics (Apache Hadoop YARN Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.metrics, class: CustomResourceMetrics

Package org.apache.hadoop.yarn.metrics

# Class CustomResourceMetrics

java.lang.Object
org.apache.hadoop.yarn.metrics.CustomResourceMetrics

public class CustomResourceMetrics extends Object
This is base class for allocated and available metrics for custom resources.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CustomResourceMetrics()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)`
  `void`
  `decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)`
  `Map<String,Long>`
  `getAllocatedValues()`
  `CustomResourceMetricValue`
  `getAvailable()`
  `Map<String,Long>`
  `getAvailableValues()`
  `void`
  `increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)`
  `void`
  `increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)`
  `Map<String,Long>`
  `initAndGetCustomResources()`
  Get a map of all custom resource metric.
  `void`
  `registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry)`
  Register all custom resources metrics as part of initialization.
  `void`
  `registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry, String metricPrefix, String metricDesc)`
  As and when this metric object construction happens for any queue, all custom resource metrics value would be initialized with '0' like any other mandatory resources metrics.
  `void`
  `setAvailable(org.apache.hadoop.yarn.api.records.Resource res)`

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

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

- ## Constructor Details

  - ### CustomResourceMetrics

    public CustomResourceMetrics()

- ## Method Details

  - ### registerCustomResources

    public void registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry)
    Register all custom resources metrics as part of initialization.
    Parameters:
      `customResources` - Map containing all custom resource types
      `registry` - of the metric type

  - ### initAndGetCustomResources

    public Map<String,Long> initAndGetCustomResources()
    Get a map of all custom resource metric.
    Returns:
      map of custom resource

  - ### registerCustomResources

    public void registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry, String metricPrefix, String metricDesc)
    As and when this metric object construction happens for any queue, all custom resource metrics value would be initialized with '0' like any other mandatory resources metrics.
    Parameters:
      `customResources` - Map containing all custom resource types
      `registry` - of the metric type
      `metricPrefix` - prefix in metric name
      `metricDesc` - suffix for metric name

  - ### setAvailable

    public void setAvailable(org.apache.hadoop.yarn.api.records.Resource res)

  - ### increaseAllocated

    public void increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)

  - ### increaseAllocated

    public void increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)

  - ### decreaseAllocated

    public void decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)

  - ### decreaseAllocated

    public void decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)

  - ### getAllocatedValues

    public Map<String,Long> getAllocatedValues()

  - ### getAvailableValues

    public Map<String,Long> getAvailableValues()

  - ### getAvailable

    public CustomResourceMetricValue getAvailable()