@InterfaceAudience.Private @Metrics(context="yarn") public class QueueMetrics extends Object implements org.apache.hadoop.metrics2.MetricsSource
Modifier and Type | Field and Description |
---|---|
protected org.apache.hadoop.conf.Configuration |
conf |
protected org.apache.hadoop.metrics2.MetricsSystem |
metricsSystem |
protected QueueMetrics |
parent |
protected static org.apache.hadoop.metrics2.MetricsInfo |
QUEUE_INFO |
protected String |
queueName |
protected org.apache.hadoop.metrics2.lib.MetricsRegistry |
registry |
protected static org.apache.hadoop.metrics2.MetricsInfo |
USER_INFO |
protected Map<String,QueueMetrics> |
users |
Modifier | Constructor and Description |
---|---|
protected |
QueueMetrics(org.apache.hadoop.metrics2.MetricsSystem ms,
String queueName,
Queue parent,
boolean enableUserMetrics,
org.apache.hadoop.conf.Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
activateApp(String user) |
void |
addAppAttemptFirstContainerAllocationDelay(long latency) |
void |
allocateResources(String partition,
String user,
int containers,
org.apache.hadoop.yarn.api.records.Resource res,
boolean decrPending) |
void |
allocateResources(String partition,
String user,
org.apache.hadoop.yarn.api.records.Resource res)
Allocate Resource for container size change.
|
static void |
clearQueueMetrics()
Helper method to clear cache.
|
protected void |
createQueueMetricsForCustomResources() |
void |
deactivateApp(String user) |
void |
decrActiveUsers() |
void |
decrPendingResources(String partition,
String user,
int containers,
org.apache.hadoop.yarn.api.records.Resource res) |
void |
fillInValuesFromAvailableResources(org.apache.hadoop.yarn.api.records.Resource fromResource,
org.apache.hadoop.yarn.api.records.Resource targetResource)
Fills in Resource values from available metrics values of custom resources
to @code{targetResource}, only if the corresponding
value of @code{targetResource} is zero.
|
void |
finishApp(String user,
RMAppState rmAppFinalState) |
void |
finishAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationId appId,
boolean isPending,
String user) |
static QueueMetrics |
forQueue(org.apache.hadoop.metrics2.MetricsSystem ms,
String queueName,
Queue parent,
boolean enableUserMetrics,
org.apache.hadoop.conf.Configuration conf) |
static QueueMetrics |
forQueue(String queueName,
Queue parent,
boolean enableUserMetrics,
org.apache.hadoop.conf.Configuration conf) |
int |
getActiveApps() |
int |
getActiveUsers() |
long |
getAggegatedReleasedContainers() |
long |
getAggregateAllocatedContainers() |
QueueMetricsCustomResource |
getAggregatedPreemptedSecondsResources()
Handle this specially as this has a long value and it could be
truncated when casted into an int parameter of
Resource.newInstance (vCores).
|
long |
getAggregateMemoryMBPreempted() |
org.apache.hadoop.metrics2.lib.MutableCounterLong |
getAggregateMemoryMBSecondsPreempted() |
long |
getAggregateNodeLocalContainersAllocated() |
long |
getAggregateOffSwitchContainersAllocated() |
long |
getAggregatePreemptedContainers() |
long |
getAggregateRackLocalContainersAllocated() |
org.apache.hadoop.metrics2.lib.MutableCounterLong |
getAggregateVcoreSecondsPreempted() |
long |
getAggregateVcoresPreempted() |
int |
getAllocatedContainers() |
long |
getAllocatedMB() |
org.apache.hadoop.yarn.api.records.Resource |
getAllocatedResources() |
int |
getAllocatedVirtualCores() |
int |
getAppsCompleted() |
int |
getAppsFailed() |
int |
getAppsKilled() |
int |
getAppsPending() |
int |
getAppsRunning() |
int |
getAppsSubmitted() |
long |
getAvailableMB() |
org.apache.hadoop.yarn.api.records.Resource |
getAvailableResources() |
int |
getAvailableVirtualCores() |
void |
getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector,
boolean all) |
org.apache.hadoop.metrics2.MetricsSystem |
getMetricsSystem() |
int |
getPendingContainers() |
long |
getPendingMB() |
org.apache.hadoop.yarn.api.records.Resource |
getPendingResources() |
int |
getPendingVirtualCores() |
protected static Map<String,QueueMetrics> |
getQueueMetrics()
Returns the metrics cache to help prevent re-registrations.
|
QueueMetricsForCustomResources |
getQueueMetricsForCustomResources() |
int |
getReservedContainers() |
long |
getReservedMB() |
org.apache.hadoop.yarn.api.records.Resource |
getReservedResources() |
int |
getReservedVirtualCores() |
QueueMetrics |
getUserMetrics(String userName) |
void |
incrActiveUsers() |
void |
incrNodeTypeAggregations(String user,
NodeType type) |
void |
incrPendingResources(String partition,
String user,
int containers,
org.apache.hadoop.yarn.api.records.Resource res)
Increment pending resource metrics
|
protected Map<String,Long> |
initAndGetCustomResources() |
void |
moveAppFrom(AppSchedulingInfo app) |
void |
moveAppTo(AppSchedulingInfo app) |
void |
preemptContainer() |
protected void |
registerCustomResources()
Register all custom resources metrics as part of initialization.
|
protected void |
registerCustomResources(Map<String,Long> customResources,
String metricPrefix,
String metricDesc) |
void |
releaseResources(String partition,
String user,
int containers,
org.apache.hadoop.yarn.api.records.Resource res) |
void |
reserveResource(String user,
org.apache.hadoop.yarn.api.records.Resource res) |
void |
reserveResource(String partition,
String user,
org.apache.hadoop.yarn.api.records.Resource res) |
void |
runAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationId appId,
String user) |
void |
setAvailableResourcesToQueue(org.apache.hadoop.yarn.api.records.Resource limit)
Set available resources.
|
void |
setAvailableResourcesToQueue(String partition,
org.apache.hadoop.yarn.api.records.Resource limit)
Set available resources.
|
void |
setAvailableResourcesToUser(String partition,
String user,
org.apache.hadoop.yarn.api.records.Resource limit)
Set available resources.
|
void |
setQueueMetricsForCustomResources(QueueMetricsForCustomResources metrics) |
protected static StringBuilder |
sourceName(String queueName) |
void |
submitApp(String user) |
void |
submitAppAttempt(String user) |
protected QueueMetrics |
tag(org.apache.hadoop.metrics2.MetricsInfo info,
String value) |
void |
unreserveResource(String partition,
String user,
org.apache.hadoop.yarn.api.records.Resource res) |
void |
updatePreemptedForCustomResources(org.apache.hadoop.yarn.api.records.Resource res) |
void |
updatePreemptedMemoryMBSeconds(long mbSeconds) |
void |
updatePreemptedResources(org.apache.hadoop.yarn.api.records.Resource res) |
void |
updatePreemptedSecondsForCustomResources(org.apache.hadoop.yarn.api.records.Resource res,
long seconds) |
void |
updatePreemptedVcoreSeconds(long vcoreSeconds) |
protected static final org.apache.hadoop.metrics2.MetricsInfo QUEUE_INFO
protected static final org.apache.hadoop.metrics2.MetricsInfo USER_INFO
protected final org.apache.hadoop.metrics2.lib.MetricsRegistry registry
protected final String queueName
protected final QueueMetrics parent
protected final org.apache.hadoop.metrics2.MetricsSystem metricsSystem
protected final Map<String,QueueMetrics> users
protected final org.apache.hadoop.conf.Configuration conf
protected QueueMetrics tag(org.apache.hadoop.metrics2.MetricsInfo info, String value)
protected static StringBuilder sourceName(String queueName)
public static QueueMetrics forQueue(String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf)
@InterfaceAudience.Private public static void clearQueueMetrics()
protected static Map<String,QueueMetrics> getQueueMetrics()
QueueMetrics
map.public static QueueMetrics forQueue(org.apache.hadoop.metrics2.MetricsSystem ms, String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf)
public QueueMetrics getUserMetrics(String userName)
public void getMetrics(org.apache.hadoop.metrics2.MetricsCollector collector, boolean all)
getMetrics
in interface org.apache.hadoop.metrics2.MetricsSource
public void submitApp(String user)
public void submitAppAttempt(String user)
public void runAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationId appId, String user)
public void finishAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationId appId, boolean isPending, String user)
public void finishApp(String user, RMAppState rmAppFinalState)
public void moveAppFrom(AppSchedulingInfo app)
public void moveAppTo(AppSchedulingInfo app)
public void setAvailableResourcesToQueue(String partition, org.apache.hadoop.yarn.api.records.Resource limit)
partition
- Node Partitionlimit
- resource limitpublic void setAvailableResourcesToQueue(org.apache.hadoop.yarn.api.records.Resource limit)
limit
- resource limitpublic void setAvailableResourcesToUser(String partition, String user, org.apache.hadoop.yarn.api.records.Resource limit)
partition
- Node Partitionuser
- limit
- resource limitpublic void incrPendingResources(String partition, String user, int containers, org.apache.hadoop.yarn.api.records.Resource res)
partition
- Node Partitionuser
- containers
- res
- the TOTAL delta of resources note this is different from
the other APIs which use per container resourceprotected void createQueueMetricsForCustomResources()
protected void registerCustomResources()
protected void registerCustomResources(Map<String,Long> customResources, String metricPrefix, String metricDesc)
public void decrPendingResources(String partition, String user, int containers, org.apache.hadoop.yarn.api.records.Resource res)
public void allocateResources(String partition, String user, int containers, org.apache.hadoop.yarn.api.records.Resource res, boolean decrPending)
public void allocateResources(String partition, String user, org.apache.hadoop.yarn.api.records.Resource res)
partition
- Node Partitionuser
- res
- public void releaseResources(String partition, String user, int containers, org.apache.hadoop.yarn.api.records.Resource res)
public void preemptContainer()
public void updatePreemptedMemoryMBSeconds(long mbSeconds)
public void updatePreemptedVcoreSeconds(long vcoreSeconds)
public void updatePreemptedResources(org.apache.hadoop.yarn.api.records.Resource res)
public void updatePreemptedForCustomResources(org.apache.hadoop.yarn.api.records.Resource res)
public void updatePreemptedSecondsForCustomResources(org.apache.hadoop.yarn.api.records.Resource res, long seconds)
public void reserveResource(String partition, String user, org.apache.hadoop.yarn.api.records.Resource res)
public void reserveResource(String user, org.apache.hadoop.yarn.api.records.Resource res)
public void unreserveResource(String partition, String user, org.apache.hadoop.yarn.api.records.Resource res)
public void incrActiveUsers()
public void decrActiveUsers()
public void activateApp(String user)
public void deactivateApp(String user)
public void addAppAttemptFirstContainerAllocationDelay(long latency)
public int getAppsSubmitted()
public int getAppsRunning()
public int getAppsPending()
public int getAppsCompleted()
public int getAppsKilled()
public int getAppsFailed()
public org.apache.hadoop.yarn.api.records.Resource getAllocatedResources()
public org.apache.hadoop.yarn.api.records.Resource getAvailableResources()
public org.apache.hadoop.yarn.api.records.Resource getPendingResources()
public org.apache.hadoop.yarn.api.records.Resource getReservedResources()
public QueueMetricsCustomResource getAggregatedPreemptedSecondsResources()
public org.apache.hadoop.metrics2.lib.MutableCounterLong getAggregateMemoryMBSecondsPreempted()
public org.apache.hadoop.metrics2.lib.MutableCounterLong getAggregateVcoreSecondsPreempted()
public long getAggregateMemoryMBPreempted()
public long getAggregateVcoresPreempted()
public long getAllocatedMB()
public int getAllocatedVirtualCores()
public int getAllocatedContainers()
public long getAvailableMB()
public int getAvailableVirtualCores()
public long getPendingMB()
public int getPendingVirtualCores()
public int getPendingContainers()
public long getReservedMB()
public int getReservedVirtualCores()
public int getReservedContainers()
public int getActiveUsers()
public int getActiveApps()
public org.apache.hadoop.metrics2.MetricsSystem getMetricsSystem()
public long getAggregateAllocatedContainers()
public long getAggregateNodeLocalContainersAllocated()
public long getAggregateRackLocalContainersAllocated()
public long getAggregateOffSwitchContainersAllocated()
public long getAggegatedReleasedContainers()
public long getAggregatePreemptedContainers()
public void fillInValuesFromAvailableResources(org.apache.hadoop.yarn.api.records.Resource fromResource, org.apache.hadoop.yarn.api.records.Resource targetResource)
fromResource
- The resource to compare available resource values with.targetResource
- The resource to save the values into.public QueueMetricsForCustomResources getQueueMetricsForCustomResources()
public void setQueueMetricsForCustomResources(QueueMetricsForCustomResources metrics)
Copyright © 2008–2020 Apache Software Foundation. All rights reserved.