Class PriorityUtilizationQueueOrderingPolicy
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.policy.PriorityUtilizationQueueOrderingPolicy
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classComparator that both looks at priority and utilizationstatic classA simple storage class to represent a snapshot of a queue. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(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.getAssignmentIterator(String partition) Return an iterator over the collection of CSQueues which orders them for container assignment.Returns configuration name (which will be used to set ordering policyvoid
-
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- relativeAssigned1relativeAssigned2- relativeAssigned2priority1- p1priority2- p2- Returns:
- compared result
-
setQueues
- Specified by:
setQueuesin interfaceQueueOrderingPolicy
-
getAssignmentIterator
Description copied from interface:QueueOrderingPolicyReturn 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:
getAssignmentIteratorin interfaceQueueOrderingPolicy- Parameters:
partition- nodePartition- Returns:
- iterator of queues to allocate
-
getConfigName
Description copied from interface:QueueOrderingPolicyReturns configuration name (which will be used to set ordering policy- Specified by:
getConfigNamein interfaceQueueOrderingPolicy- Returns:
- configuration name
-
getQueues
-