Class PriorityUtilizationQueueOrderingPolicy

java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.policy.PriorityUtilizationQueueOrderingPolicy
All Implemented Interfaces:
QueueOrderingPolicy

public class PriorityUtilizationQueueOrderingPolicy extends Object implements QueueOrderingPolicy
For two queues with the same priority: - The queue with less relative used-capacity goes first - today’s behavior. - The default priority for all queues is 0 and equal. So, we get today’s behaviour at every level - the queue with the lowest used-capacity percentage gets the resources For two queues with different priorities: - Both the queues are under their guaranteed capacities: The queue with the higher priority gets resources - Both the queues are over or meeting their guaranteed capacities: The queue with the higher priority gets resources - One of the queues is over or meeting their guaranteed capacities and the other is under: The queue that is under its capacity guarantee gets the resources.
  • Constructor Details

    • PriorityUtilizationQueueOrderingPolicy

      public PriorityUtilizationQueueOrderingPolicy(boolean respectPriority)
  • Method Details

    • compare

      public static int compare(double relativeAssigned1, double relativeAssigned2, int priority1, int priority2)
      Compare two queues with possibly different priority and assigned capacity, Will be used by preemption policy as well.
      Parameters:
      relativeAssigned1 - relativeAssigned1
      relativeAssigned2 - relativeAssigned2
      priority1 - p1
      priority2 - p2
      Returns:
      compared result
    • setQueues

      public void setQueues(List<CSQueue> queues)
      Specified by:
      setQueues in interface QueueOrderingPolicy
    • getAssignmentIterator

      public Iterator<CSQueue> getAssignmentIterator(String partition)
      Description copied from interface: QueueOrderingPolicy
      Return an iterator over the collection of CSQueues which orders them for container assignment. Please note that, to avoid queue's set updated during sorting / iterating. Caller need to make sure parent queue's read lock is properly acquired.
      Specified by:
      getAssignmentIterator in interface QueueOrderingPolicy
      Parameters:
      partition - nodePartition
      Returns:
      iterator of queues to allocate
    • getConfigName

      public String getConfigName()
      Description copied from interface: QueueOrderingPolicy
      Returns configuration name (which will be used to set ordering policy
      Specified by:
      getConfigName in interface QueueOrderingPolicy
      Returns:
      configuration name
    • getQueues

      @VisibleForTesting public List<CSQueue> getQueues()