@InterfaceAudience.Private @InterfaceStability.Unstable public class FSAppAttempt extends SchedulerApplicationAttempt implements Schedulable
SchedulerApplicationAttempt.AMStateappAMNodePartitionName, appSchedulingInfo, attemptId, attemptResourceUsage, isStopped, lastMemoryAggregateAllocationUpdateTime, lastScheduledContainer, liveContainers, newlyAllocatedContainers, newlyDecreasedContainers, newlyIncreasedContainers, queue, reservedContainers, rmContext, updatedNMTokens| Constructor and Description |
|---|
FSAppAttempt(FairScheduler scheduler,
org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
String user,
FSLeafQueue queue,
ActiveUsersManager activeUsersManager,
RMContext rmContext) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPreemption(RMContainer container,
long time) |
RMContainer |
allocate(NodeType type,
FSSchedulerNode node,
org.apache.hadoop.yarn.api.records.Priority priority,
org.apache.hadoop.yarn.api.records.ResourceRequest request,
org.apache.hadoop.yarn.api.records.Container container) |
org.apache.hadoop.yarn.api.records.Resource |
assignContainer(FSSchedulerNode node)
Assign a container on this node if possible, and return the amount of
resources assigned.
|
boolean |
assignReservedContainer(FSSchedulerNode node)
Called when this application already has an existing reservation on the
given node.
|
void |
clearPreemptedResources() |
void |
containerCompleted(RMContainer rmContainer,
org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus,
RMContainerEventType event) |
org.apache.hadoop.yarn.api.records.Container |
createContainer(FSSchedulerNode node,
org.apache.hadoop.yarn.api.records.Resource capability,
org.apache.hadoop.yarn.api.records.Priority priority)
Create and return a container object reflecting an allocation for the
given appliction on the given node with the given capability and
priority.
|
NodeType |
getAllowedLocalityLevel(org.apache.hadoop.yarn.api.records.Priority priority,
int numNodes,
double nodeLocalityThreshold,
double rackLocalityThreshold)
Return the level at which we are allowed to schedule containers, given the
current size of the cluster and thresholds indicating how many nodes to
fail at (as a fraction of cluster size) before relaxing scheduling
constraints.
|
NodeType |
getAllowedLocalityLevelByTime(org.apache.hadoop.yarn.api.records.Priority priority,
long nodeLocalityDelayMs,
long rackLocalityDelayMs,
long currentTimeMs)
Return the level at which we are allowed to schedule containers.
|
Long |
getContainerPreemptionTime(RMContainer container) |
org.apache.hadoop.yarn.api.records.Resource |
getDemand()
Maximum number of resources required by this Schedulable.
|
org.apache.hadoop.yarn.api.records.Resource |
getFairShare()
Get the fair share assigned to this Schedulable.
|
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.
|
float |
getLocalityWaitFactor(org.apache.hadoop.yarn.api.records.Priority priority,
int clusterNodes) |
org.apache.hadoop.yarn.api.records.Resource |
getMaxShare()
Maximum Resource share assigned to the schedulable.
|
QueueMetrics |
getMetrics()
Get metrics reference from containing queue.
|
org.apache.hadoop.yarn.api.records.Resource |
getMinShare()
Minimum Resource share assigned to the schedulable.
|
String |
getName()
Name of job/queue, used for debugging as well as for breaking ties in
scheduling order deterministically.
|
org.apache.hadoop.yarn.api.records.Resource |
getPreemptedResources() |
Set<RMContainer> |
getPreemptionContainers() |
org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Get the priority of the application
|
FSLeafQueue |
getQueue() |
org.apache.hadoop.yarn.api.records.Resource |
getResourceUsage()
Get the aggregate amount of resources consumed by the schedulable.
|
ResourceWeights |
getResourceWeights() |
long |
getStartTime()
Start time for jobs in FIFO queues; meaningless for QueueSchedulables.
|
ResourceWeights |
getWeights()
Job/queue weight in fair sharing.
|
RMContainer |
preemptContainer()
Preempt a running container according to the priority
|
void |
resetAllowedLocalityLevel(org.apache.hadoop.yarn.api.records.Priority priority,
NodeType level)
Should be called when the scheduler assigns a container at a higher
degree of locality than the current threshold.
|
void |
resetPreemptedResources() |
void |
setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Assign a fair share to this Schedulable.
|
void |
unreserve(org.apache.hadoop.yarn.api.records.Priority priority,
FSSchedulerNode node)
Remove the reservation on
node at the given Priority. |
void |
updateDemand()
Refresh the Schedulable's demand and those of its children if any.
|
addMissedNonPartitionedRequestSchedulingOpportunity, addReReservation, addSchedulingOpportunity, compareInputOrderTo, containerLaunchedOnNode, decreaseContainer, getActivedAppDiagnosticMessage, getAMResource, getAMResource, getAppAMNodePartitionName, getAppAttemptResourceUsage, getApplicationAttemptId, getApplicationId, getAppSchedulingInfo, getBlacklistedNodes, getCurrentConsumption, getCurrentReservation, getId, getLastScheduledContainer, getLiveContainers, getLiveContainersMap, getNewContainerId, getNumReservedContainers, getPendingAppDiagnosticMessage, getPendingRelease, getPriorities, getQueueName, getReReservations, getReservedContainers, getResource, getResourceLimit, getResourceRequest, getResourceRequests, getResourceUsageReport, getRMContainer, getSchedulingOpportunities, getSchedulingResourceUsage, getTotalRequiredResources, getUnmanagedAM, getUser, hasPendingResourceRequest, incNumAllocatedContainers, increaseContainer, isAmRunning, isPending, isPlaceBlacklisted, isRecovering, isReserved, isStopped, isWaitingForAMContainer, move, pullNewlyAllocatedContainers, pullNewlyDecreasedContainers, pullNewlyIncreasedContainers, pullUpdatedNMTokens, recordContainerAllocationTime, recordContainerRequestTime, recoverContainer, recoverResourceRequestsForContainer, removeIncreaseRequest, reserve, reserveIncreasedContainer, resetMissedNonPartitionedRequestSchedulingOpportunity, resetReReservations, resetSchedulingOpportunities, resetSchedulingOpportunities, setAMResource, setAMResource, setAmRunning, setAppAMNodePartitionName, setApplicationHeadroomForMetrics, setAttemptRecovering, setHeadroom, setPriority, showRequests, stop, subtractSchedulingOpportunity, transferStateFromPreviousAttempt, updateAMContainerDiagnostics, updateBlacklist, updateIncreaseRequests, updateResourceRequestspublic FSAppAttempt(FairScheduler scheduler, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, FSLeafQueue queue, ActiveUsersManager activeUsersManager, RMContext rmContext)
public ResourceWeights getResourceWeights()
public QueueMetrics getMetrics()
public void containerCompleted(RMContainer rmContainer, org.apache.hadoop.yarn.api.records.ContainerStatus containerStatus, RMContainerEventType event)
public org.apache.hadoop.yarn.api.records.Resource getHeadroom()
getHeadroom in class SchedulerApplicationAttemptpublic float getLocalityWaitFactor(org.apache.hadoop.yarn.api.records.Priority priority,
int clusterNodes)
public NodeType getAllowedLocalityLevel(org.apache.hadoop.yarn.api.records.Priority priority, int numNodes, double nodeLocalityThreshold, double rackLocalityThreshold)
public NodeType getAllowedLocalityLevelByTime(org.apache.hadoop.yarn.api.records.Priority priority, long nodeLocalityDelayMs, long rackLocalityDelayMs, long currentTimeMs)
public RMContainer allocate(NodeType type, FSSchedulerNode node, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ResourceRequest request, org.apache.hadoop.yarn.api.records.Container container)
public void resetAllowedLocalityLevel(org.apache.hadoop.yarn.api.records.Priority priority,
NodeType level)
public void addPreemption(RMContainer container, long time)
public Long getContainerPreemptionTime(RMContainer container)
public Set<RMContainer> getPreemptionContainers()
public FSLeafQueue getQueue()
getQueue in class SchedulerApplicationAttemptpublic org.apache.hadoop.yarn.api.records.Resource getPreemptedResources()
public void resetPreemptedResources()
public void clearPreemptedResources()
public org.apache.hadoop.yarn.api.records.Container createContainer(FSSchedulerNode node, org.apache.hadoop.yarn.api.records.Resource capability, org.apache.hadoop.yarn.api.records.Priority priority)
public void unreserve(org.apache.hadoop.yarn.api.records.Priority priority,
FSSchedulerNode node)
node at the given Priority.
This dispatches SchedulerNode handlers as well.public boolean assignReservedContainer(FSSchedulerNode node)
node - Node that the application has an existing reservation onpublic String getName()
SchedulablegetName in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getDemand()
SchedulablegetDemand in interface Schedulablepublic long getStartTime()
SchedulablegetStartTime in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getMinShare()
SchedulablegetMinShare in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getMaxShare()
SchedulablegetMaxShare in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
SchedulablegetResourceUsage in interface Schedulablepublic ResourceWeights getWeights()
SchedulablegetWeights in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Priority getPriority()
SchedulableEntitygetPriority in interface SchedulablegetPriority in interface SchedulableEntitygetPriority in class SchedulerApplicationAttemptpublic org.apache.hadoop.yarn.api.records.Resource getFairShare()
SchedulablegetFairShare in interface Schedulablepublic void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
SchedulablesetFairShare in interface Schedulablepublic void updateDemand()
SchedulableupdateDemand in interface Schedulablepublic org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
SchedulableassignContainer in interface Schedulablepublic RMContainer preemptContainer()
preemptContainer in interface SchedulableCopyright © 2017 Apache Software Foundation. All Rights Reserved.