java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.AbstractPreemptionEntity
org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.TempQueuePerPartition

public class TempQueuePerPartition extends AbstractPreemptionEntity
Temporary data-structure tracking resource availability, pending resource need, current utilization. This is per-queue-per-partition data structure
  • 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

      public void setLeafQueue(AbstractLeafQueue l)
    • addChild

      public void addChild(TempQueuePerPartition q)
      When adding a child we also aggregate its pending resource needs.
      Parameters:
      q - the child queue to add to this queue
    • getChildren

      public ArrayList<TempQueuePerPartition> 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

      public String toString()
      Overrides:
      toString in class Object
    • 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

      public void addAllApps(Collection<TempAppPerPartition> orderedApps)
    • getApps

      public Collection<TempAppPerPartition> getApps()
    • addUserPerPartition

      public void addUserPerPartition(String userName, TempUserPerPartition tmpUser)
    • getUsersPerPartition

      public Map<String,TempUserPerPartition> getUsersPerPartition()
    • setPending

      public void setPending(org.apache.hadoop.yarn.api.records.Resource pending)
    • getIdealAssigned

      public org.apache.hadoop.yarn.api.records.Resource getIdealAssigned()
    • toGlobalString

      public String 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 - the ResourceCalculator to be used
      clusterResource - the total cluster resources
      offered - 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.