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

@Metrics(context="yarn") public class FSQueueMetrics extends QueueMetrics
  • Method Details

    • getFairShare

      public org.apache.hadoop.yarn.api.records.Resource getFairShare()
      Get instantaneous fair share of the queue.
      Returns:
      the returned Resource also contains custom resource types
    • setFairShare

      public void setFairShare(org.apache.hadoop.yarn.api.records.Resource resource)
      Set instantaneous fair share of the queue.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • getSteadyFairShareMB

      public long getSteadyFairShareMB()
    • getSteadyFairShareVCores

      public long getSteadyFairShareVCores()
    • getSteadyFairShare

      public org.apache.hadoop.yarn.api.records.Resource getSteadyFairShare()
      Get steady fair share for queue.
      Returns:
      the returned Resource also contains custom resource types
    • setSteadyFairShare

      public void setSteadyFairShare(org.apache.hadoop.yarn.api.records.Resource resource)
      Set steady fair share for queue.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • getMinShareMB

      public long getMinShareMB()
    • getMinShareVirtualCores

      public long getMinShareVirtualCores()
    • getMinShare

      public org.apache.hadoop.yarn.api.records.Resource getMinShare()
      Get minimum required resource share for queue.
      Returns:
      the returned Resource also contains custom resource types
    • setMinShare

      public void setMinShare(org.apache.hadoop.yarn.api.records.Resource resource)
      Set minimum required resource share for queue.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • getMaxShareMB

      public long getMaxShareMB()
    • getMaxShareVirtualCores

      public long getMaxShareVirtualCores()
    • getMaxShare

      public org.apache.hadoop.yarn.api.records.Resource getMaxShare()
      Get maximum allowed resource share for queue.
      Returns:
      the returned Resource also contains custom resource types
    • setMaxShare

      public void setMaxShare(org.apache.hadoop.yarn.api.records.Resource resource)
      Set maximum allowed resource share for queue.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • getMaxApps

      public int getMaxApps()
    • setMaxApps

      public void setMaxApps(int max)
    • getMaxAMShareMB

      public long getMaxAMShareMB()
      Get the maximum memory size AM can use in MB.
      Returns:
      the maximum memory size AM can use
    • getMaxAMShareVCores

      public int getMaxAMShareVCores()
      Get the maximum number of VCores AM can use.
      Returns:
      the maximum number of VCores AM can use
    • getMaxAMShare

      public org.apache.hadoop.yarn.api.records.Resource getMaxAMShare()
      Get maximum resource AM can use.
      Returns:
      the returned Resource also contains custom resource types
    • setMaxAMShare

      public void setMaxAMShare(org.apache.hadoop.yarn.api.records.Resource resource)
      Set the maximum resource AM can use.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • 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 Resource also contains custom resource types
    • setAMResourceUsage

      public void setAMResourceUsage(org.apache.hadoop.yarn.api.records.Resource resource)
      Set the AM resource usage.
      Parameters:
      resource - the passed Resource object may also contain custom resource types
    • getSchedulingPolicy

      @Metric("Scheduling policy") public String getSchedulingPolicy()
      Get the scheduling policy.
      Returns:
      the scheduling policy
    • setSchedulingPolicy

      public void setSchedulingPolicy(String policy)
    • 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 system
      queueName - queue name
      parent - parent queue
      enableUserMetrics - if user metrics is needed
      conf - configuration
      Returns:
      an FSQueueMetrics object