Package org.apache.hadoop.yarn.metrics
Class CustomResourceMetrics
java.lang.Object
org.apache.hadoop.yarn.metrics.CustomResourceMetrics
This is base class for allocated and available metrics for
custom resources.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res) voiddecreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers) voidincreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res) voidincreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers) Get a map of all custom resource metric.voidregisterCustomResources(Map<String, Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry) Register all custom resources metrics as part of initialization.voidregisterCustomResources(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.voidsetAvailable(org.apache.hadoop.yarn.api.records.Resource res)
-
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 typesregistry- of the metric type
-
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 typesregistry- of the metric typemetricPrefix- prefix in metric namemetricDesc- 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
-
getAvailableValues
-
getAvailable
-