Class FifoPolicy
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.policies.FifoPolicy
-
Field Summary
FieldsFields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
DEFAULT_POLICY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckIfUsageOverFairShare(org.apache.hadoop.yarn.api.records.Resource usage, org.apache.hadoop.yarn.api.records.Resource fairShare) Check if the resource usage is over the fair share under this policy.voidcomputeShares(Collection<? extends Schedulable> schedulables, org.apache.hadoop.yarn.api.records.Resource totalResources) Computes and updates the shares ofSchedulables as per theSchedulingPolicy, to be used later for scheduling decisions.voidcomputeSteadyShares(Collection<? extends FSQueue> queues, org.apache.hadoop.yarn.api.records.Resource totalResources) Computes and updates the steady shares ofFSQueues as per theSchedulingPolicy.The comparator returned by this method is to be used for sorting theSchedulables in that queue.org.apache.hadoop.yarn.api.records.ResourcegetHeadroom(org.apache.hadoop.yarn.api.records.Resource queueFairShare, org.apache.hadoop.yarn.api.records.Resource queueUsage, org.apache.hadoop.yarn.api.records.Resource maxAvailable) Get headroom by calculating the min ofclusterAvailableand (queueFairShare-queueUsage) resources that are applicable to this policy.getName()org.apache.hadoop.yarn.util.resource.ResourceCalculatorTheResourceCalculatorreturned by this method should be used for any calculations involving resources.booleanisChildPolicyAllowed(SchedulingPolicy childPolicy) Check whether the policy of a child queue is allowed.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.SchedulingPolicy
getInstance, initialize, initialize, parse
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
FifoPolicy
public FifoPolicy()
-
-
Method Details
-
getName
- Specified by:
getNamein classSchedulingPolicy- Returns:
- returns the name of
SchedulingPolicy
-
getComparator
Description copied from class:SchedulingPolicyThe comparator returned by this method is to be used for sorting theSchedulables in that queue.- Specified by:
getComparatorin classSchedulingPolicy- Returns:
- the comparator to sort by
-
getResourceCalculator
public org.apache.hadoop.yarn.util.resource.ResourceCalculator getResourceCalculator()Description copied from class:SchedulingPolicyTheResourceCalculatorreturned by this method should be used for any calculations involving resources.- Specified by:
getResourceCalculatorin classSchedulingPolicy- Returns:
- ResourceCalculator instance to use
-
getHeadroom
public org.apache.hadoop.yarn.api.records.Resource getHeadroom(org.apache.hadoop.yarn.api.records.Resource queueFairShare, org.apache.hadoop.yarn.api.records.Resource queueUsage, org.apache.hadoop.yarn.api.records.Resource maxAvailable) Description copied from class:SchedulingPolicyGet headroom by calculating the min ofclusterAvailableand (queueFairShare-queueUsage) resources that are applicable to this policy. For eg if only memory then leave other resources such as CPU to same asclusterAvailable.- Specified by:
getHeadroomin classSchedulingPolicy- Parameters:
queueFairShare- fairshare in the queuequeueUsage- resources used in the queuemaxAvailable- available resource in cluster for this queue- Returns:
- calculated headroom
-
isChildPolicyAllowed
Description copied from class:SchedulingPolicyCheck whether the policy of a child queue is allowed.- Overrides:
isChildPolicyAllowedin classSchedulingPolicy- Parameters:
childPolicy- the policy of child queue- Returns:
- true if the child policy is allowed; false otherwise
-