Enum Class NodeQueueLoadMonitor.LoadComparator
java.lang.Object
java.lang.Enum<NodeQueueLoadMonitor.LoadComparator>
org.apache.hadoop.yarn.server.resourcemanager.scheduler.distributed.NodeQueueLoadMonitor.LoadComparator
- All Implemented Interfaces:
Serializable,Comparable<NodeQueueLoadMonitor.LoadComparator>,Constable,Comparator<ClusterNode>
- Enclosing class:
- NodeQueueLoadMonitor
public static enum NodeQueueLoadMonitor.LoadComparator
extends Enum<NodeQueueLoadMonitor.LoadComparator>
implements Comparator<ClusterNode>
The comparator used to specify the metric against which the load
of two Nodes are compared.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThis policy only considers queue length.This policy considers both queue length and resources.This policy only considers the wait time of containers in the queue. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(ClusterNode o1, ClusterNode o2) booleancompareAndIncrement(ClusterNode c, int incrementSize, org.apache.hadoop.yarn.api.records.Resource requested) Increment the metric by a delta if it is below the threshold.intorg.apache.hadoop.yarn.util.resource.ResourceCalculatorbooleanWhether we should be placing OContainers on a node.Returns the enum constant of this class with the specified name.static NodeQueueLoadMonitor.LoadComparator[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Enum Constant Details
-
QUEUE_LENGTH
This policy only considers queue length. When allocating, increments queue length without looking at resources available on the node, and when sorting, also only sorts by queue length. -
QUEUE_WAIT_TIME
This policy only considers the wait time of containers in the queue. Neither looks at resources nor at queue length. -
QUEUE_LENGTH_THEN_RESOURCES
This policy considers both queue length and resources. When allocating, first decrements resources available on a node. If resources are available, does not place OContainers on the node queue. When sorting, it first sorts by queue length, then by available resources.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
compare
- Specified by:
comparein interfaceComparator<ClusterNode>
-
getResourceCalculator
public org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator() -
getMetric
-
compareAndIncrement
public boolean compareAndIncrement(ClusterNode c, int incrementSize, org.apache.hadoop.yarn.api.records.Resource requested) Increment the metric by a delta if it is below the threshold.- Parameters:
c- ClusterNodeincrementSize- increment sizerequested- the requested resource- Returns:
- true if the metric was below threshold and was incremented.
-
isNodeAvailable
Whether we should be placing OContainers on a node.- Parameters:
cn- the clusterNode- Returns:
- whether we should be placing OContainers on a node.
-