Class TempQueuePerPartition
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.AbstractPreemptionEntity
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.TempQueuePerPartition
Temporary data-structure tracking resource availability, pending resource
need, current utilization. This is per-queue-per-partition data structure
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.hadoop.yarn.api.records.ResourceFields inherited from class org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.AbstractPreemptionEntity
amUsed, current, pending, reserved -
Constructor Summary
ConstructorsConstructorDescriptionTempQueuePerPartition(String queueName, org.apache.hadoop.yarn.api.records.Resource current, boolean preemptionDisabled, String partition, org.apache.hadoop.yarn.api.records.Resource killable, float absCapacity, float absMaxCapacity, org.apache.hadoop.yarn.api.records.Resource totalPartitionResource, org.apache.hadoop.yarn.api.records.Resource reserved, CSQueue queue, org.apache.hadoop.yarn.api.records.Resource effMinRes, org.apache.hadoop.yarn.api.records.Resource effMaxRes) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.hadoop.yarn.api.records.ResourceacceptedByLocality(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource offered) This method is visible to allow sub-classes to override the behavior, specifically to take into account locality-based limitations of how much the queue can consumed.voidaddAllApps(Collection<TempAppPerPartition> orderedApps) voidWhen adding a child we also aggregate its pending resource needs.voidaddUserPerPartition(String userName, TempUserPerPartition tmpUser) voidassignPreemption(float scalingFactor, org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource clusterResource) voiddeductActuallyToBePreempted(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource cluster, org.apache.hadoop.yarn.api.records.Resource toBeDeduct) protected org.apache.hadoop.yarn.api.records.ResourcefilterByMaxDeductAssigned(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource offered) This method is visible to allow sub-classes to override the behavior, specifically for federation purposes we do not want to cap resources as it is done here.floatgetApps()org.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.api.records.Resourceorg.apache.hadoop.yarn.api.records.ResourcegetMax()protected voidThis method is visible to allow sub-classes to ovverride the behavior, specifically for federation purposes we need to initialize per-sub-cluster roots as well as the global one.voidvoidsetPending(org.apache.hadoop.yarn.api.records.Resource pending) toString()voidupdatePreemptableExtras(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc) Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.AbstractPreemptionEntity
getActuallyToBePreempted, getAMUsed, getPending, getQueueName, getReserved, getToBePreemptFromOther, getUsed, getUsedDeductAM, setActuallyToBePreempted, setToBePreemptFromOther
-
Field Details
-
pendingDeductReserved
protected org.apache.hadoop.yarn.api.records.Resource pendingDeductReserved
-
-
Constructor Details
-
TempQueuePerPartition
public TempQueuePerPartition(String queueName, org.apache.hadoop.yarn.api.records.Resource current, boolean preemptionDisabled, String partition, org.apache.hadoop.yarn.api.records.Resource killable, float absCapacity, float absMaxCapacity, org.apache.hadoop.yarn.api.records.Resource totalPartitionResource, org.apache.hadoop.yarn.api.records.Resource reserved, CSQueue queue, org.apache.hadoop.yarn.api.records.Resource effMinRes, org.apache.hadoop.yarn.api.records.Resource effMaxRes)
-
-
Method Details
-
setLeafQueue
-
addChild
When adding a child we also aggregate its pending resource needs.- Parameters:
q- the child queue to add to this queue
-
getChildren
-
getAbsCapacity
public float getAbsCapacity() -
getGuaranteed
public org.apache.hadoop.yarn.api.records.Resource getGuaranteed() -
getMax
public org.apache.hadoop.yarn.api.records.Resource getMax() -
updatePreemptableExtras
public void updatePreemptableExtras(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc) -
toString
-
assignPreemption
public void assignPreemption(float scalingFactor, org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource clusterResource) -
deductActuallyToBePreempted
public void deductActuallyToBePreempted(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource cluster, org.apache.hadoop.yarn.api.records.Resource toBeDeduct) -
addAllApps
-
getApps
-
addUserPerPartition
-
getUsersPerPartition
-
setPending
public void setPending(org.apache.hadoop.yarn.api.records.Resource pending) -
getIdealAssigned
public org.apache.hadoop.yarn.api.records.Resource getIdealAssigned() -
toGlobalString
-
acceptedByLocality
protected org.apache.hadoop.yarn.api.records.Resource acceptedByLocality(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource offered) This method is visible to allow sub-classes to override the behavior, specifically to take into account locality-based limitations of how much the queue can consumed.- Parameters:
rc- the ResourceCalculator to be used.offered- the input amount of Resource offered to this queue.- Returns:
- the subset of Resource(s) that the queue can consumed after accounting for locality effects.
-
filterByMaxDeductAssigned
protected org.apache.hadoop.yarn.api.records.Resource filterByMaxDeductAssigned(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource offered) This method is visible to allow sub-classes to override the behavior, specifically for federation purposes we do not want to cap resources as it is done here.- Parameters:
rc- theResourceCalculatorto be usedclusterResource- the total cluster resourcesoffered- the resources offered to this queue- Returns:
- the amount of resources accepted after considering max and deducting assigned.
-
initializeRootIdealWithGuarangeed
protected void initializeRootIdealWithGuarangeed()This method is visible to allow sub-classes to ovverride the behavior, specifically for federation purposes we need to initialize per-sub-cluster roots as well as the global one.
-