Class FSAppAttempt
java.lang.Object
org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
org.apache.hadoop.yarn.server.resourcemanager.scheduler.fair.FSAppAttempt
- All Implemented Interfaces:
Schedulable,SchedulableEntity
@Private
@Unstable
public class FSAppAttempt
extends SchedulerApplicationAttempt
implements Schedulable
Represents an application attempt from the viewpoint of the Fair 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
ConstructorsConstructorDescriptionFSAppAttempt(FairScheduler scheduler, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, FSLeafQueue queue, ActiveUsersManager activeUsersManager, RMContext rmContext) -
Method Summary
Modifier and TypeMethodDescriptionallocate(NodeType type, FSSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, PendingAsk pendingAsk, org.apache.hadoop.yarn.api.records.Container reservedContainer) org.apache.hadoop.yarn.api.records.ResourceAssign a container on this node if possible, and return the amount of resources assigned.booleanorg.apache.hadoop.yarn.api.records.ResourceMaximum number of resources required by this Schedulable.org.apache.hadoop.yarn.api.records.ResourceGet the fair share assigned to this Schedulable.org.apache.hadoop.yarn.api.records.ResourceHeadroom depends on resources in the cluster, current usage of the queue, queue's fair-share and queue's max-resources.org.apache.hadoop.yarn.api.records.ResourceMaximum Resource share assigned to the schedulable.Get metrics reference from containing queue.org.apache.hadoop.yarn.api.records.ResourceMinimum Resource share assigned to the schedulable.getName()Name of job/queue, used for debugging as well as for breaking ties in scheduling order deterministically.org.apache.hadoop.yarn.api.records.PriorityGet the priority of the application.getQueue()org.apache.hadoop.yarn.api.records.ResourceGet the aggregate amount of resources consumed by the schedulable.longStart time of the job.floatJob/queue weight in fair sharing.inthashCode()booleanCheck whether the schedulable is preemptable.booleanrecoverContainer(SchedulerNode node, RMContainer rmContainer) voidsetEnableAMPreemption(boolean enableAMPreemption) voidsetFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare) Assign a fair share to this Schedulable.toString()voidunreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FSSchedulerNode node) Remove the reservation onnodeat the given SchedulerRequestKey.voidRefresh the Schedulable's demand and those of its children if any.Methods inherited from class org.apache.hadoop.yarn.server.resourcemanager.scheduler.SchedulerApplicationAttempt
addMissedNonPartitionedRequestSchedulingOpportunity, addReReservation, addRMContainer, addSchedulingOpportunity, addToNewlyAllocatedContainers, addToNewlyDecreasedContainers, addToNewlyDemotedContainers, addToUpdateContainerErrors, compareInputOrderTo, containerLaunchedOnNode, decUnconfirmedRes, getActivedAppDiagnosticMessage, getAMResource, getAMResource, getAppAMNodePartitionName, getAppAttemptResourceUsage, getApplicationAttemptId, getApplicationId, getApplicationSchedulingEnvs, getAppPlacementAllocator, getAppSchedulingInfo, getBlacklistedNodes, getCurrentConsumption, getCurrentReservation, getId, getLastScheduledContainer, getLiveContainers, getLiveContainersMap, getNewContainerId, getNumReservedContainers, getOpportunisticContainerContext, getOutstandingAsksCount, getOutstandingAsksCount, getPartition, getPendingAppDiagnosticMessage, getPendingAsk, getPendingRelease, getQueueName, getReReservations, getReservedContainers, getResourceUsageReport, getRMContainer, getSchedulerKeys, getSchedulingOpportunities, getSchedulingResourceUsage, getUnmanagedAM, getUpdateContext, getUser, getWriteLock, hasPendingResourceRequest, incNumAllocatedContainers, incUnconfirmedRes, isAmRunning, isPending, isPlaceBlacklisted, isRecovering, isStopped, isWaitingForAMContainer, move, pullNewlyAllocatedContainers, pullNewlyDecreasedContainers, pullNewlyDemotedContainers, pullNewlyIncreasedContainers, pullNewlyPromotedContainers, pullPreviousAttemptContainers, pullUpdateContainerErrors, pullUpdatedNMTokens, recordContainerAllocationTime, recordContainerRequestTime, recoverResourceRequestsForContainer, removeRMContainer, reserve, reserveIncreasedContainer, resetMissedNonPartitionedRequestSchedulingOpportunity, resetReReservations, resetSchedulingOpportunities, resetSchedulingOpportunities, setAMResource, setAMResource, setAmRunning, setAppAMNodePartitionName, setApplicationHeadroomForMetrics, setAttemptRecovering, setHeadroom, setOpportunisticContainerContext, setPriority, showRequests, stop, subtractSchedulingOpportunity, transferStateFromPreviousAttempt, updateAMContainerDiagnostics, updateBlacklist, updateNMTokens, updateResourceRequests, updateSchedulingRequests
-
Constructor Details
-
FSAppAttempt
public FSAppAttempt(FairScheduler scheduler, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, FSLeafQueue queue, ActiveUsersManager activeUsersManager, RMContext rmContext)
-
-
Method Details
-
getMetrics
Get metrics reference from containing queue.- Returns:
- metrics reference from containing queue.
-
getHeadroom
public org.apache.hadoop.yarn.api.records.Resource getHeadroom()Headroom depends on resources in the cluster, current usage of the queue, queue's fair-share and queue's max-resources.- Overrides:
getHeadroomin classSchedulerApplicationAttempt- Returns:
- available resource headroom
-
allocate
public RMContainer allocate(NodeType type, FSSchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, PendingAsk pendingAsk, org.apache.hadoop.yarn.api.records.Container reservedContainer) -
getQueue
- Overrides:
getQueuein classSchedulerApplicationAttempt
-
recoverContainer
- Overrides:
recoverContainerin classSchedulerApplicationAttempt
-
unreserve
public void unreserve(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, FSSchedulerNode node) Remove the reservation onnodeat the given SchedulerRequestKey. This dispatches SchedulerNode handlers as well.- Parameters:
schedulerKey- Scheduler Keynode- Node
-
getName
Description copied from interface:SchedulableName of job/queue, used for debugging as well as for breaking ties in scheduling order deterministically.- Specified by:
getNamein interfaceSchedulable- Returns:
- Name of job/queue.
-
getDemand
public org.apache.hadoop.yarn.api.records.Resource getDemand()Description copied from interface:SchedulableMaximum 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).- Specified by:
getDemandin interfaceSchedulable- Returns:
- resources required by this Schedulable.
-
getStartTime
public long getStartTime()Description copied from interface:SchedulableEntityStart time of the job.- Specified by:
getStartTimein interfaceSchedulable- Specified by:
getStartTimein interfaceSchedulableEntity- Overrides:
getStartTimein classSchedulerApplicationAttempt- Returns:
- start time
-
getResourceUsage
public org.apache.hadoop.yarn.api.records.Resource getResourceUsage()Description copied from interface:SchedulableGet the aggregate amount of resources consumed by the schedulable.- Specified by:
getResourceUsagein interfaceSchedulable- Returns:
- aggregate amount of resources.
-
getWeight
public float getWeight()Description copied from interface:SchedulableJob/queue weight in fair sharing. Weights are only meaningful when compared. A weight of 2.0f has twice the weight of a weight of 1.0f, which has twice the weight of a weight of 0.5f. A weight of 1.0f is considered unweighted or a neutral weight. A weight of 0 is no weight.- Specified by:
getWeightin interfaceSchedulable- Returns:
- the weight
-
getPriority
public org.apache.hadoop.yarn.api.records.Priority getPriority()Description copied from interface:SchedulableEntityGet the priority of the application.- Specified by:
getPriorityin interfaceSchedulable- Specified by:
getPriorityin interfaceSchedulableEntity- Overrides:
getPriorityin classSchedulerApplicationAttempt- Returns:
- priority of the application.
-
updateDemand
public void updateDemand()Description copied from interface:SchedulableRefresh the Schedulable's demand and those of its children if any.- Specified by:
updateDemandin interfaceSchedulable
-
assignContainer
Description copied from interface:SchedulableAssign a container on this node if possible, and return the amount of resources assigned.- Specified by:
assignContainerin interfaceSchedulable- Parameters:
node- FSSchedulerNode.- Returns:
- the amount of resources assigned.
-
hashCode
public int hashCode()- Overrides:
hashCodein classSchedulerApplicationAttempt
-
equals
- Overrides:
equalsin classSchedulerApplicationAttempt
-
toString
-
isPreemptable
public boolean isPreemptable()Description copied from interface:SchedulableCheck whether the schedulable is preemptable.- Specified by:
isPreemptablein interfaceSchedulable- Returns:
trueif the schedulable is preemptable;falseotherwise
-
setEnableAMPreemption
@VisibleForTesting public void setEnableAMPreemption(boolean enableAMPreemption)
-