java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
org.apache.hadoop.yarn.server.resourcemanager.scheduler.common.fica.FiCaSchedulerApp
All Implemented Interfaces:
SchedulableEntity
Direct Known Subclasses:
FifoAppAttempt

@Private @Unstable public class FiCaSchedulerApp extends SchedulerApplicationAttempt
Represents an application attempt from the viewpoint of the FIFO or Capacity scheduler.
  • Constructor Details

    • FiCaSchedulerApp

      public FiCaSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, AbstractUsersManager abstractUsersManager, RMContext rmContext)
    • FiCaSchedulerApp

      public FiCaSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, AbstractUsersManager abstractUsersManager, RMContext rmContext, org.apache.hadoop.yarn.api.records.Priority appPriority, boolean isAttemptRecovering)
    • FiCaSchedulerApp

      public FiCaSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, AbstractUsersManager abstractUsersManager, RMContext rmContext, org.apache.hadoop.yarn.api.records.Priority appPriority, boolean isAttemptRecovering, ActivitiesManager activitiesManager)
  • Method Details

    • containerCompleted

      public boolean containerCompleted(RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, String partition)
    • allocate

      public RMContainer allocate(FiCaSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Container container)
    • accept

      public boolean accept(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp,FiCaSchedulerNode> request, boolean checkPending)
    • apply

      public boolean apply(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp,FiCaSchedulerNode> request, boolean updatePending)
    • unreserve

      public boolean unreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FiCaSchedulerNode node, RMContainer rmContainer)
    • getTotalPendingRequestsPerPartition

      public Map<String,org.apache.hadoop.yarn.api.records.Resource> getTotalPendingRequestsPerPartition()
    • markContainerForPreemption

      public void markContainerForPreemption(org.apache.hadoop.yarn.api.records.ContainerId cont)
    • getAllocation

      public Allocation getAllocation(org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator, org.apache.hadoop.yarn.api.records.Resource clusterResource, org.apache.hadoop.yarn.api.records.Resource minimumAllocation)
      This method produces an Allocation that includes the current view of the resources that will be allocated to and preempted from this application.
      Parameters:
      resourceCalculator - resourceCalculator
      clusterResource - clusterResource
      minimumAllocation - minimumAllocation
      Returns:
      an allocation
    • getNodeIdToUnreserve

      @VisibleForTesting public org.apache.hadoop.yarn.api.records.NodeId getNodeIdToUnreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Resource resourceNeedUnreserve, org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator)
    • setHeadroomProvider

      public void setHeadroomProvider(CapacityHeadroomProvider headroomProvider)
    • getHeadroom

      public org.apache.hadoop.yarn.api.records.Resource getHeadroom()
      Description copied from class: SchedulerApplicationAttempt
      Get available headroom in terms of resources for the application's user.
      Overrides:
      getHeadroom in class SchedulerApplicationAttempt
      Returns:
      available resource headroom
    • transferStateFromPreviousAttempt

      public void transferStateFromPreviousAttempt(SchedulerApplicationAttempt appAttempt)
      Overrides:
      transferStateFromPreviousAttempt in class SchedulerApplicationAttempt
    • reserve

      public void reserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FiCaSchedulerNode node, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Container container, boolean reReservation)
    • findNodeToUnreserve

      @VisibleForTesting public RMContainer findNodeToUnreserve(FiCaSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Resource minimumUnreservedResource)
    • getCSLeafQueue

      public AbstractLeafQueue getCSLeafQueue()
    • assignContainers

      public CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> ps, ResourceLimits currentResourceLimits, SchedulingMode schedulingMode, RMContainer reservedContainer)
    • nodePartitionUpdated

      public void nodePartitionUpdated(RMContainer rmContainer, String oldPartition, String newPartition)
    • getPendingAppDiagnosticMessage

      protected void getPendingAppDiagnosticMessage(StringBuilder diagnosticMessage)
      Overrides:
      getPendingAppDiagnosticMessage in class SchedulerApplicationAttempt
    • getActivedAppDiagnosticMessage

      protected void getActivedAppDiagnosticMessage(StringBuilder diagnosticMessage)
      Overrides:
      getActivedAppDiagnosticMessage in class SchedulerApplicationAttempt
    • updateAppSkipNodeDiagnostics

      public void updateAppSkipNodeDiagnostics(String message)
      Set the message temporarily if the reason is known for why scheduling did not happen for a given node, if not message will be over written
      Parameters:
      message - Message of app skip diagnostics
    • updateNodeInfoForAMDiagnostics

      public void updateNodeInfoForAMDiagnostics(FiCaSchedulerNode node)
    • getAppPlacementAllocator

      public AppPlacementAllocator<FiCaSchedulerNode> getAppPlacementAllocator(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey)
      Overrides:
      getAppPlacementAllocator in class SchedulerApplicationAttempt
    • getResourceUsageReport

      public org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getResourceUsageReport()
      Recalculates the per-app, percent of queue metric, specific to the Capacity Scheduler.
      Overrides:
      getResourceUsageReport in class SchedulerApplicationAttempt
    • getWriteLock

      public ReentrantReadWriteLock.WriteLock getWriteLock()
      Overrides:
      getWriteLock in class SchedulerApplicationAttempt
    • addToBeRemovedIncreaseRequest

      public void addToBeRemovedIncreaseRequest(SchedContainerChangeRequest request)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SchedulerApplicationAttempt
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class SchedulerApplicationAttempt
    • moveReservation

      public boolean moveReservation(RMContainer reservedContainer, FiCaSchedulerNode sourceNode, FiCaSchedulerNode targetNode)
      Move reservation from one node to another Comparing to unreserve container on source node and reserve a new container on target node. This method will not create new RMContainer instance. And this operation is atomic.
      Parameters:
      reservedContainer - to be moved reserved container
      sourceNode - source node
      targetNode - target node
      Returns:
      succeeded or not
    • setRunnable

      public void setRunnable(boolean runnable)
    • isRunnable

      public boolean isRunnable()