java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSQueue
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSLeafQueue
All Implemented Interfaces:
Schedulable, Queue

@Private @Unstable public class FSLeafQueue extends FSQueue
  • Constructor Details

  • Method Details

    • collectSchedulerApplications

      public void collectSchedulerApplications(Collection<org.apache.hadoop.yarn.api.records.ApplicationAttemptId> apps)
      Description copied from class: FSQueue
      Adds all applications in the queue and its subqueues to the given collection.
      Specified by:
      collectSchedulerApplications in class FSQueue
      Parameters:
      apps - the collection to add the applications to
    • getDemand

      public org.apache.hadoop.yarn.api.records.Resource getDemand()
      Description copied from interface: Schedulable
      Maximum number of resources required by this Schedulable. This is defined as number of currently utilized resources + number of unlaunched resources (that are either not yet launched or need to be speculated).
      Returns:
      resources required by this Schedulable.
    • updateDemand

      public void updateDemand()
      Description copied from interface: Schedulable
      Refresh the Schedulable's demand and those of its children if any.
    • assignContainer

      public org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
      Description copied from interface: Schedulable
      Assign a container on this node if possible, and return the amount of resources assigned.
      Parameters:
      node - FSSchedulerNode.
      Returns:
      the amount of resources assigned.
    • getChildQueues

      public List<FSQueue> getChildQueues()
      Description copied from class: FSQueue
      Gets the children of this queue, if any.
      Specified by:
      getChildQueues in class FSQueue
      Returns:
      the children of this queue.
    • getQueueUserAclInfo

      public List<org.apache.hadoop.yarn.api.records.QueueUserACLInfo> getQueueUserAclInfo(org.apache.hadoop.security.UserGroupInformation user)
      Description copied from interface: Queue
      Get queue ACLs for given user.
      Parameters:
      user - username
      Returns:
      queue ACLs for user
    • getNumRunnableApps

      public int getNumRunnableApps()
      Description copied from class: FSQueue
      Return the number of apps for which containers can be allocated. Includes apps in subqueues.
      Specified by:
      getNumRunnableApps in class FSQueue
      Returns:
      the number of apps.
    • getNumPendingApps

      public int getNumPendingApps()
    • getNumAssignedApps

      public int getNumAssignedApps()
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in class FSQueue
    • getNumActiveApps

      public int getNumActiveApps()
      TODO: Based on how frequently this is called, we might want to club counting pending and active apps in the same method.
      Returns:
      active apps.
    • getAbstractUsersManager

      public ActiveUsersManager getAbstractUsersManager()
    • canRunAppAM

      public boolean canRunAppAM(org.apache.hadoop.yarn.api.records.Resource amResource)
      Check whether this queue can run the Application Master under the maxAMShare limit.
      Parameters:
      amResource - resources required to run the AM
      Returns:
      true if this queue can run
    • recoverContainer

      public void recoverContainer(org.apache.hadoop.yarn.api.records.Resource clusterResource, SchedulerApplicationAttempt schedulerAttempt, RMContainer rmContainer)
      Description copied from interface: Queue
      Recover the state of the queue for a given container.
      Parameters:
      clusterResource - the resource of the cluster
      schedulerAttempt - the application for which the container was allocated
      rmContainer - the container that was recovered.
    • setWeights

      public void setWeights(float weight)
      Allows setting weight for a dynamically created queue. Currently only used for reservation based queues.
      Overrides:
      setWeights in class FSQueue
      Parameters:
      weight - queue weight
    • getMaximumContainerAllocation

      public org.apache.hadoop.yarn.api.records.Resource getMaximumContainerAllocation()
      Specified by:
      getMaximumContainerAllocation in class FSQueue
    • dumpStateInternal

      protected void dumpStateInternal(StringBuilder sb)
      Description copied from class: FSQueue
      Recursively dump states of all queues.
      Specified by:
      dumpStateInternal in class FSQueue
      Parameters:
      sb - the {code StringBuilder} which holds queue states
    • addAssignedApp

      public void addAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
      This method is called when an application is assigned to this queue for book-keeping purposes (to be able to determine if the queue is empty).
      Parameters:
      applicationId - the application's id
    • removeAssignedApp

      public void removeAssignedApp(org.apache.hadoop.yarn.api.records.ApplicationId applicationId)
      This method is called when an application is removed from this queue during the submit process.
      Parameters:
      applicationId - the application's id