Class DominantResourceFairnessPolicy.DominantResourceFairnessComparator
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies.DominantResourceFairnessPolicy.DominantResourceFairnessComparator
- All Implemented Interfaces:
Comparator<Schedulable>
- Enclosing class:
- DominantResourceFairnessPolicy
public abstract static class DominantResourceFairnessPolicy.DominantResourceFairnessComparator
extends Object
implements Comparator<Schedulable>
This class compares two
Schedulable instances according to the
DRF policy. If neither instance is below min share, approximate fair share
ratios are compared. Subclasses of this class will do the actual work of
the comparison, specialized for the number of configured resource types.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intcompareAttributes(Schedulable s1, Schedulable s2) This method is used when apps are tied in fairness ratio.voidsetFSContext(FSContext fsContext) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
fsContext
-
-
Constructor Details
-
DominantResourceFairnessComparator
public DominantResourceFairnessComparator()
-
-
Method Details
-
setFSContext
-
compareAttributes
This method is used when apps are tied in fairness ratio. It breaks the tie by submit time and job name to get a deterministic ordering, which is useful for unit tests.- Parameters:
s1- the first item to compares2- the second item to compare- Returns:
- < 0, 0, or > 0 if the first item is less than, equal to, or greater than the second item, respectively
-