public static enum NodeQueueLoadMonitor.LoadComparator extends Enum<NodeQueueLoadMonitor.LoadComparator> implements Comparator<ClusterNode>
Enum Constant and Description |
---|
QUEUE_LENGTH
This policy only considers queue length.
|
QUEUE_LENGTH_THEN_RESOURCES
This policy considers both queue length and resources.
|
QUEUE_WAIT_TIME
This policy only considers the wait time of containers in the queue.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(ClusterNode o1,
ClusterNode o2) |
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.
|
int |
getMetric(ClusterNode c) |
org.apache.hadoop.yarn.util.resource.ResourceCalculator |
getResourceCalculator() |
boolean |
isNodeAvailable(ClusterNode cn)
Whether we should be placing OContainers on a node.
|
static NodeQueueLoadMonitor.LoadComparator |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NodeQueueLoadMonitor.LoadComparator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final NodeQueueLoadMonitor.LoadComparator QUEUE_LENGTH
public static final NodeQueueLoadMonitor.LoadComparator QUEUE_WAIT_TIME
public static final NodeQueueLoadMonitor.LoadComparator QUEUE_LENGTH_THEN_RESOURCES
public static NodeQueueLoadMonitor.LoadComparator[] values()
for (NodeQueueLoadMonitor.LoadComparator c : NodeQueueLoadMonitor.LoadComparator.values()) System.out.println(c);
public static NodeQueueLoadMonitor.LoadComparator valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int compare(ClusterNode o1, ClusterNode o2)
compare
in interface Comparator<ClusterNode>
public org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()
public int getMetric(ClusterNode c)
public boolean compareAndIncrement(ClusterNode c, int incrementSize, org.apache.hadoop.yarn.api.records.Resource requested)
c
- ClusterNodeincrementSize
- increment sizerequested
- the requested resourcepublic boolean isNodeAvailable(ClusterNode cn)
cn
- the clusterNodeCopyright © 2008–2024 Apache Software Foundation. All rights reserved.