@InterfaceAudience.Private @InterfaceStability.Unstable public class FSAppAttempt extends SchedulerApplicationAttempt implements Schedulable
SchedulerApplicationAttempt.ContainersAndNMTokensAllocation
appSchedulingInfo, attemptId, currentConsumption, currentReservation, isStopped, lastMemoryAggregateAllocationUpdateTime, lastScheduledContainer, liveContainers, newlyAllocatedContainers, queue, reservedContainers, rmContext
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 |
addNonEligibleForPreemption(RMContainer container) |
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.
|
org.apache.hadoop.yarn.api.records.Resource |
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()
Get available headroom in terms of resources for the application's user.
|
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.
|
Set<RMContainer> |
getNonEligibleForPreemptionSet() |
org.apache.hadoop.yarn.api.records.Resource |
getPreemptedResources() |
Set<RMContainer> |
getPreemptionContainers() |
org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Job priority for jobs in FIFO queues; meaningless for QueueSchedulables.
|
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.
|
boolean |
hasContainerForNode(org.apache.hadoop.yarn.api.records.Priority prio,
FSSchedulerNode node)
Whether this app has containers requests that could be satisfied on the
given node, if the node had full space.
|
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 |
resetNonEligibleForPreemptionSet() |
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.
|
addReReservation, addSchedulingOpportunity, containerLaunchedOnNode, getAMResource, getApplicationAttemptId, getApplicationId, getAppSchedulingInfo, getCurrentConsumption, getCurrentReservation, getLastScheduledContainer, getLiveContainers, getLiveContainersMap, getNewContainerId, getNumReservedContainers, getPendingRelease, getPriorities, getQueueName, getReReservations, getReservedContainers, getResource, getResourceLimit, getResourceRequest, getResourceRequests, getResourceUsageReport, getRMContainer, getSchedulingOpportunities, getTotalRequiredResources, getUnmanagedAM, getUser, incNumAllocatedContainers, isAmRunning, isBlacklisted, isBlacklisted, isPending, isReserved, isStopped, move, pullNewlyAllocatedContainersAndNMTokens, recoverContainer, recoverResourceRequests, reserve, resetReReservations, resetSchedulingOpportunities, resetSchedulingOpportunities, setAMResource, setAmRunning, setApplicationHeadroomForMetrics, setHeadroom, showRequests, stop, subtractSchedulingOpportunity, transferStateFromPreviousAttempt, updateBlacklist, updateResourceRequests
public 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()
SchedulerApplicationAttempt
getHeadroom
in class SchedulerApplicationAttempt
public 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 void addNonEligibleForPreemption(RMContainer container)
public Set<RMContainer> getNonEligibleForPreemptionSet()
public void resetNonEligibleForPreemptionSet()
public Long getContainerPreemptionTime(RMContainer container)
public Set<RMContainer> getPreemptionContainers()
public FSLeafQueue getQueue()
getQueue
in class SchedulerApplicationAttempt
public 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 org.apache.hadoop.yarn.api.records.Resource assignReservedContainer(FSSchedulerNode node)
node
- Node that the application has an existing reservation onpublic boolean hasContainerForNode(org.apache.hadoop.yarn.api.records.Priority prio, FSSchedulerNode node)
public String getName()
Schedulable
getName
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getDemand()
Schedulable
getDemand
in interface Schedulable
public long getStartTime()
Schedulable
getStartTime
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getMinShare()
Schedulable
getMinShare
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getMaxShare()
Schedulable
getMaxShare
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getResourceUsage()
Schedulable
getResourceUsage
in interface Schedulable
public ResourceWeights getWeights()
Schedulable
getWeights
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Priority getPriority()
Schedulable
getPriority
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource getFairShare()
Schedulable
getFairShare
in interface Schedulable
public void setFairShare(org.apache.hadoop.yarn.api.records.Resource fairShare)
Schedulable
setFairShare
in interface Schedulable
public void updateDemand()
Schedulable
updateDemand
in interface Schedulable
public org.apache.hadoop.yarn.api.records.Resource assignContainer(FSSchedulerNode node)
Schedulable
assignContainer
in interface Schedulable
public RMContainer preemptContainer()
preemptContainer
in interface Schedulable
Copyright © 2015 Apache Software Foundation. All Rights Reserved.