public class CustomResourceMetrics extends Object
Constructor and Description |
---|
CustomResourceMetrics() |
Modifier and Type | Method and 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) |
public void registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry)
customResources
- Map containing all custom resource typesregistry
- of the metric typepublic Map<String,Long> initAndGetCustomResources()
public void registerCustomResources(Map<String,Long> customResources, org.apache.hadoop.metrics2.lib.MetricsRegistry registry, String metricPrefix, String metricDesc)
customResources
- Map containing all custom resource typesregistry
- of the metric typemetricPrefix
- prefix in metric namemetricDesc
- suffix for metric namepublic void setAvailable(org.apache.hadoop.yarn.api.records.Resource res)
public void increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)
public void increaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)
public void decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res)
public void decreaseAllocated(org.apache.hadoop.yarn.api.records.Resource res, int containers)
public CustomResourceMetricValue getAvailable()
Copyright © 2008–2024 Apache Software Foundation. All rights reserved.