Class FSQueueMetrics
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueueMetrics
- All Implemented Interfaces:
org.apache.hadoop.metrics2.MetricsSource
-
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics
conf, DEFAULT_PARTITION, DEFAULT_PARTITION_JMX_STR, METRIC_NAME_DELIMITER, metricsSystem, P_RECORD_INFO, PARTITION_INFO, QUEUE_INFO, queueName, registry, storedPartitionMetrics, USER_INFO, users -
Method Summary
Modifier and TypeMethodDescriptionstatic FSQueueMetricsforQueue(String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf) static FSQueueMetricsforQueue(org.apache.hadoop.metrics2.MetricsSystem ms, String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf) Get the FS queue metric for the given queue.org.apache.hadoop.yarn.api.records.ResourceGet resource usage of the AM.longGet the AM memory usage in MB.intGet the AM VCore usage.org.apache.hadoop.yarn.api.records.ResourceGet instantaneous fair share of the queue.org.apache.hadoop.yarn.api.records.ResourceGet maximum resource AM can use.longGet the maximum memory size AM can use in MB.intGet the maximum number of VCores AM can use.intorg.apache.hadoop.yarn.api.records.ResourceGet maximum allowed resource share for queue.longlongorg.apache.hadoop.yarn.api.records.ResourceGet minimum required resource share for queue.longlongGet the scheduling policy.org.apache.hadoop.yarn.api.records.ResourceGet steady fair share for queue.longlongvoidsetAMResourceUsage(org.apache.hadoop.yarn.api.records.Resource resource) Set the AM resource usage.voidsetFairShare(org.apache.hadoop.yarn.api.records.Resource resource) Set instantaneous fair share of the queue.voidsetMaxAMShare(org.apache.hadoop.yarn.api.records.Resource resource) Set the maximum resource AM can use.voidsetMaxApps(int max) voidsetMaxShare(org.apache.hadoop.yarn.api.records.Resource resource) Set maximum allowed resource share for queue.voidsetMinShare(org.apache.hadoop.yarn.api.records.Resource resource) Set minimum required resource share for queue.voidsetSchedulingPolicy(String policy) voidsetSteadyFairShare(org.apache.hadoop.yarn.api.records.Resource resource) Set steady fair share for queue.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.QueueMetrics
activateApp, addAppAttemptFirstContainerAllocationDelay, allocateResources, allocateResources, clearQueueMetrics, createQueueMetricsForCustomResources, deactivateApp, decrActiveUsers, decrPendingResources, decrReserveResource, fillInValuesFromAvailableResources, finishApp, finishAppAttempt, getActiveApps, getActiveUsers, getAggegatedReleasedContainers, getAggregateAllocatedContainers, getAggregatedPreemptedSecondsResources, getAggregateMemoryMBPreempted, getAggregateMemoryMBSecondsPreempted, getAggregateNodeLocalContainersAllocated, getAggregateOffSwitchContainersAllocated, getAggregatePreemptedContainers, getAggregateRackLocalContainersAllocated, getAggregateVcoreSecondsPreempted, getAggregateVcoresPreempted, getAllocatedContainers, getAllocatedMB, getAllocatedResources, getAllocatedVirtualCores, getAppsCompleted, getAppsFailed, getAppsKilled, getAppsPending, getAppsRunning, getAppsSubmitted, getAvailableMB, getAvailableResources, getAvailableVirtualCores, getMetrics, getMetricsSystem, getParentQueue, getPartitionQueueMetrics, getPendingContainers, getPendingMB, getPendingResources, getPendingVirtualCores, getQueueMetrics, getQueueMetricsForCustomResources, getReservedContainers, getReservedMB, getReservedResources, getReservedVirtualCores, getUnmanagedAppsCompleted, getUnmanagedAppsFailed, getUnmanagedAppsPending, getUnmanagedAppsRunning, getUnmanagedAppsSubmitted, getUserMetrics, incrActiveUsers, incrNodeTypeAggregations, incrPendingResources, incrReserveResources, internalAllocateResources, internalDecrPendingResources, internalIncrPendingResources, internalReleaseResources, internalReserveResources, internalUnReserveResources, isConfigurationValidationSet, moveAppFrom, moveAppTo, preemptContainer, registerCustomResources, registerPartitionMetricsCreation, releaseResources, reserveResource, runAppAttempt, setAvailableResources, setAvailableResourcesToQueue, setAvailableResourcesToQueue, setAvailableResourcesToUser, setConfigurationValidation, setParent, setParentQueue, setQueueMetricsForCustomResources, sourceName, submitApp, submitAppAttempt, tag, unreserveResource, updatePreemptedForCustomResources, updatePreemptedMemoryMBSeconds, updatePreemptedResources, updatePreemptedSecondsForCustomResources, updatePreemptedVcoreSeconds
-
Method Details
-
getMaxApps
public int getMaxApps() -
setMaxApps
public void setMaxApps(int max) -
getAMResourceUsageMB
public long getAMResourceUsageMB()Get the AM memory usage in MB.- Returns:
- the AM memory usage
-
getAMResourceUsageVCores
public int getAMResourceUsageVCores()Get the AM VCore usage.- Returns:
- the AM VCore usage
-
getAMResourceUsage
public org.apache.hadoop.yarn.api.records.Resource getAMResourceUsage()Get resource usage of the AM.- Returns:
- the returned
Resourcealso contains custom resource types
-
setAMResourceUsage
public void setAMResourceUsage(org.apache.hadoop.yarn.api.records.Resource resource) Set the AM resource usage.- Parameters:
resource- the passedResourceobject may also contain custom resource types
-
getSchedulingPolicy
Get the scheduling policy.- Returns:
- the scheduling policy
-
setSchedulingPolicy
-
forQueue
public static FSQueueMetrics forQueue(String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf) -
forQueue
@VisibleForTesting public static FSQueueMetrics forQueue(org.apache.hadoop.metrics2.MetricsSystem ms, String queueName, Queue parent, boolean enableUserMetrics, org.apache.hadoop.conf.Configuration conf) Get the FS queue metric for the given queue. Create one and register it to metrics system if there isn't one for the queue.- Parameters:
ms- the metric systemqueueName- queue nameparent- parent queueenableUserMetrics- if user metrics is neededconf- configuration- Returns:
- an FSQueueMetrics object