Class FiCaSchedulerApp
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
Represents an application attempt from the viewpoint of the FIFO or Capacity
scheduler.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
SchedulerApplicationAttempt.AMState -
Field Summary
Fields inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
appAMNodePartitionName, appSchedulingInfo, attemptId, attemptOpportunisticResourceUsage, attemptResourceUsage, attemptResourceUsageAllocatedRemotely, isStopped, lastMemoryAggregateAllocationUpdateTime, lastScheduledContainer, liveContainers, newlyAllocatedContainers, newlyDecreasedContainers, newlyDemotedContainers, newlyIncreasedContainers, newlyPromotedContainers, queue, readLock, reservedContainers, rmContext, tempContainerToKill, updateContainerErrors, updatedNMTokens, writeLock -
Constructor Summary
ConstructorsConstructorDescriptionFiCaSchedulerApp(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, AbstractUsersManager abstractUsersManager, RMContext rmContext) 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(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 Summary
Modifier and TypeMethodDescriptionbooleanaccept(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request, boolean checkPending) voidallocate(FiCaSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Container container) booleanapply(org.apache.hadoop.yarn.api.records.Resource cluster, ResourceCommitRequest<FiCaSchedulerApp, FiCaSchedulerNode> request, boolean updatePending) assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> ps, ResourceLimits currentResourceLimits, SchedulingMode schedulingMode, RMContainer reservedContainer) booleancontainerCompleted(RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event, String partition) booleanfindNodeToUnreserve(FiCaSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Resource minimumUnreservedResource) protected voidgetActivedAppDiagnosticMessage(StringBuilder diagnosticMessage) 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.getAppPlacementAllocator(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey) org.apache.hadoop.yarn.api.records.ResourceGet available headroom in terms of resources for the application's user.org.apache.hadoop.yarn.api.records.NodeIdgetNodeIdToUnreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, org.apache.hadoop.yarn.api.records.Resource resourceNeedUnreserve, org.apache.hadoop.yarn.util.resource.ResourceCalculator resourceCalculator) protected voidgetPendingAppDiagnosticMessage(StringBuilder diagnosticMessage) org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReportRecalculates the per-app, percent of queue metric, specific to the Capacity Scheduler.inthashCode()booleanvoidmarkContainerForPreemption(org.apache.hadoop.yarn.api.records.ContainerId cont) booleanmoveReservation(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.voidnodePartitionUpdated(RMContainer rmContainer, String oldPartition, String newPartition) voidreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FiCaSchedulerNode node, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Container container, boolean reReservation) voidsetHeadroomProvider(CapacityHeadroomProvider headroomProvider) voidsetRunnable(boolean runnable) voidbooleanunreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FiCaSchedulerNode node, RMContainer rmContainer) voidupdateAppSkipNodeDiagnostics(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 writtenvoidMethods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
addMissedNonPartitionedRequestSchedulingOpportunity, addReReservation, addRMContainer, addSchedulingOpportunity, addToNewlyAllocatedContainers, addToNewlyDecreasedContainers, addToNewlyDemotedContainers, addToUpdateContainerErrors, compareInputOrderTo, containerLaunchedOnNode, decUnconfirmedRes, getAMResource, getAMResource, getAppAMNodePartitionName, getAppAttemptResourceUsage, getApplicationAttemptId, getApplicationId, getApplicationSchedulingEnvs, getAppSchedulingInfo, getBlacklistedNodes, getCurrentConsumption, getCurrentReservation, getId, getLastScheduledContainer, getLiveContainers, getLiveContainersMap, getNewContainerId, getNumReservedContainers, getOpportunisticContainerContext, getOutstandingAsksCount, getOutstandingAsksCount, getPartition, getPendingAsk, getPendingRelease, getPriority, getQueue, getQueueName, getReReservations, getReservedContainers, getRMContainer, getSchedulerKeys, getSchedulingOpportunities, getSchedulingResourceUsage, getStartTime, getUnmanagedAM, getUpdateContext, getUser, hasPendingResourceRequest, incNumAllocatedContainers, incUnconfirmedRes, isAmRunning, isPending, isPlaceBlacklisted, isRecovering, isStopped, isWaitingForAMContainer, move, pullNewlyAllocatedContainers, pullNewlyDecreasedContainers, pullNewlyDemotedContainers, pullNewlyIncreasedContainers, pullNewlyPromotedContainers, pullPreviousAttemptContainers, pullUpdateContainerErrors, pullUpdatedNMTokens, recordContainerAllocationTime, recordContainerRequestTime, recoverContainer, recoverResourceRequestsForContainer, removeRMContainer, reserve, reserveIncreasedContainer, resetMissedNonPartitionedRequestSchedulingOpportunity, resetReReservations, resetSchedulingOpportunities, resetSchedulingOpportunities, setAMResource, setAMResource, setAmRunning, setAppAMNodePartitionName, setApplicationHeadroomForMetrics, setAttemptRecovering, setHeadroom, setOpportunisticContainerContext, setPriority, showRequests, stop, subtractSchedulingOpportunity, updateAMContainerDiagnostics, updateBlacklist, updateNMTokens, updateResourceRequests, updateSchedulingRequests
-
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
-
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- resourceCalculatorclusterResource- clusterResourceminimumAllocation- 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
-
getHeadroom
public org.apache.hadoop.yarn.api.records.Resource getHeadroom()Description copied from class:SchedulerApplicationAttemptGet available headroom in terms of resources for the application's user.- Overrides:
getHeadroomin classSchedulerApplicationAttempt- Returns:
- available resource headroom
-
transferStateFromPreviousAttempt
- Overrides:
transferStateFromPreviousAttemptin classSchedulerApplicationAttempt
-
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
-
assignContainers
public CSAssignment assignContainers(org.apache.hadoop.yarn.api.records.Resource clusterResource, CandidateNodeSet<FiCaSchedulerNode> ps, ResourceLimits currentResourceLimits, SchedulingMode schedulingMode, RMContainer reservedContainer) -
nodePartitionUpdated
-
getPendingAppDiagnosticMessage
- Overrides:
getPendingAppDiagnosticMessagein classSchedulerApplicationAttempt
-
getActivedAppDiagnosticMessage
- Overrides:
getActivedAppDiagnosticMessagein classSchedulerApplicationAttempt
-
updateAppSkipNodeDiagnostics
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
-
getAppPlacementAllocator
public AppPlacementAllocator<FiCaSchedulerNode> getAppPlacementAllocator(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey) - Overrides:
getAppPlacementAllocatorin classSchedulerApplicationAttempt
-
getResourceUsageReport
public org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getResourceUsageReport()Recalculates the per-app, percent of queue metric, specific to the Capacity Scheduler.- Overrides:
getResourceUsageReportin classSchedulerApplicationAttempt
-
getWriteLock
- Overrides:
getWriteLockin classSchedulerApplicationAttempt
-
addToBeRemovedIncreaseRequest
-
hashCode
public int hashCode()- Overrides:
hashCodein classSchedulerApplicationAttempt
-
equals
- Overrides:
equalsin classSchedulerApplicationAttempt
-
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 containersourceNode- source nodetargetNode- target node- Returns:
- succeeded or not
-
setRunnable
public void setRunnable(boolean runnable) -
isRunnable
public boolean isRunnable()
-