org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies
Class DominantResourceFairnessPolicy

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
      extended by org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies.DominantResourceFairnessPolicy

@InterfaceAudience.Private
@InterfaceStability.Unstable
public class DominantResourceFairnessPolicy
extends SchedulingPolicy

Makes scheduling decisions by trying to equalize dominant resource usage. A schedulable's dominant resource usage is the largest ratio of resource usage to capacity among the resource types it is using.


Nested Class Summary
static class DominantResourceFairnessPolicy.DominantResourceFairnessComparator
           
 
Field Summary
static String NAME
           
 
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
DEPTH_ANY, DEPTH_INTERMEDIATE, DEPTH_LEAF, DEPTH_PARENT, DEPTH_ROOT
 
Constructor Summary
DominantResourceFairnessPolicy()
           
 
Method Summary
 void computeShares(Collection<? extends Schedulable> schedulables, org.apache.hadoop.yarn.api.records.Resource totalResources)
          Computes and updates the shares of Schedulables as per the SchedulingPolicy, to be used later at schedule time.
 byte getApplicableDepth()
          Specifies the depths in the hierarchy, this SchedulingPolicy applies to
 Comparator<Schedulable> getComparator()
          The comparator returned by this method is to be used for sorting the Schedulables in that queue.
 String getName()
           
 void initialize(org.apache.hadoop.yarn.api.records.Resource clusterCapacity)
           
 
Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
getDefault, getInstance, isApplicableTo, parse, setDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values
Constructor Detail

DominantResourceFairnessPolicy

public DominantResourceFairnessPolicy()
Method Detail

getName

public String getName()
Specified by:
getName in class SchedulingPolicy
Returns:
returns the name of SchedulingPolicy

getApplicableDepth

public byte getApplicableDepth()
Description copied from class: SchedulingPolicy
Specifies the depths in the hierarchy, this SchedulingPolicy applies to

Specified by:
getApplicableDepth in class SchedulingPolicy
Returns:
depth equal to one of fields SchedulingPolicy#DEPTH_*

getComparator

public Comparator<Schedulable> getComparator()
Description copied from class: SchedulingPolicy
The comparator returned by this method is to be used for sorting the Schedulables in that queue.

Specified by:
getComparator in class SchedulingPolicy
Returns:
the comparator to sort by

computeShares

public void computeShares(Collection<? extends Schedulable> schedulables,
                          org.apache.hadoop.yarn.api.records.Resource totalResources)
Description copied from class: SchedulingPolicy
Computes and updates the shares of Schedulables as per the SchedulingPolicy, to be used later at schedule time.

Specified by:
computeShares in class SchedulingPolicy
Parameters:
schedulables - Schedulables whose shares are to be updated
totalResources - Total Resources in the cluster

initialize

public void initialize(org.apache.hadoop.yarn.api.records.Resource clusterCapacity)
Overrides:
initialize in class SchedulingPolicy


Copyright © 2014 Apache Software Foundation. All Rights Reserved.