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 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()