@InterfaceAudience.Private @InterfaceStability.Unstable public class SchedulerApplicationAttempt extends Object implements SchedulableEntity
Modifier and Type | Class and Description |
---|---|
static class |
SchedulerApplicationAttempt.AMState |
Modifier and Type | Field and Description |
---|---|
protected String |
appAMNodePartitionName |
protected AppSchedulingInfo |
appSchedulingInfo |
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
attemptId |
protected ResourceUsage |
attemptResourceUsage |
protected boolean |
isStopped |
protected long |
lastMemoryAggregateAllocationUpdateTime |
protected Map<org.apache.hadoop.yarn.api.records.Priority,Long> |
lastScheduledContainer |
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
liveContainers |
protected List<RMContainer> |
newlyAllocatedContainers |
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
newlyDecreasedContainers |
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
newlyIncreasedContainers |
protected Queue |
queue |
protected Map<org.apache.hadoop.yarn.api.records.Priority,Map<org.apache.hadoop.yarn.api.records.NodeId,RMContainer>> |
reservedContainers |
protected RMContext |
rmContext |
protected Set<org.apache.hadoop.yarn.api.records.NMToken> |
updatedNMTokens |
Constructor and Description |
---|
SchedulerApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
String user,
Queue queue,
ActiveUsersManager activeUsersManager,
RMContext rmContext) |
Modifier and Type | Method and Description |
---|---|
int |
addMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority) |
protected void |
addReReservation(org.apache.hadoop.yarn.api.records.Priority priority) |
void |
addSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority) |
int |
compareInputOrderTo(SchedulableEntity other)
Compare the passed SchedulableEntity to this one for input order.
|
void |
containerLaunchedOnNode(org.apache.hadoop.yarn.api.records.ContainerId containerId,
org.apache.hadoop.yarn.api.records.NodeId nodeId) |
void |
decreaseContainer(SchedContainerChangeRequest decreaseRequest) |
protected void |
getActivedAppDiagnosticMessage(StringBuilder diagnosticMessage) |
org.apache.hadoop.yarn.api.records.Resource |
getAMResource() |
org.apache.hadoop.yarn.api.records.Resource |
getAMResource(String label) |
String |
getAppAMNodePartitionName() |
ResourceUsage |
getAppAttemptResourceUsage() |
org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
getApplicationAttemptId()
Get
ApplicationAttemptId of the application master. |
org.apache.hadoop.yarn.api.records.ApplicationId |
getApplicationId() |
AppSchedulingInfo |
getAppSchedulingInfo() |
Set<String> |
getBlacklistedNodes() |
org.apache.hadoop.yarn.api.records.Resource |
getCurrentConsumption() |
org.apache.hadoop.yarn.api.records.Resource |
getCurrentReservation()
Get total current reservations.
|
org.apache.hadoop.yarn.api.records.Resource |
getHeadroom()
Get available headroom in terms of resources for the application's user.
|
String |
getId()
Id - each entity must have a unique id
|
Map<org.apache.hadoop.yarn.api.records.Priority,Long> |
getLastScheduledContainer() |
Collection<RMContainer> |
getLiveContainers()
Get the live containers of the application.
|
Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
getLiveContainersMap() |
long |
getNewContainerId() |
int |
getNumReservedContainers(org.apache.hadoop.yarn.api.records.Priority priority) |
protected void |
getPendingAppDiagnosticMessage(StringBuilder diagnosticMessage) |
Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getPendingRelease() |
Collection<org.apache.hadoop.yarn.api.records.Priority> |
getPriorities() |
org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Get the priority of the application
|
Queue |
getQueue() |
String |
getQueueName() |
int |
getReReservations(org.apache.hadoop.yarn.api.records.Priority priority) |
List<RMContainer> |
getReservedContainers()
Get the list of reserved containers
|
org.apache.hadoop.yarn.api.records.Resource |
getResource(org.apache.hadoop.yarn.api.records.Priority priority) |
org.apache.hadoop.yarn.api.records.Resource |
getResourceLimit() |
org.apache.hadoop.yarn.api.records.ResourceRequest |
getResourceRequest(org.apache.hadoop.yarn.api.records.Priority priority,
String resourceName) |
Map<String,org.apache.hadoop.yarn.api.records.ResourceRequest> |
getResourceRequests(org.apache.hadoop.yarn.api.records.Priority priority) |
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
getResourceUsageReport() |
RMContainer |
getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId id) |
int |
getSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority)
Return the number of times the application has been given an opportunity
to schedule a task at the given priority since the last time it
successfully did so.
|
ResourceUsage |
getSchedulingResourceUsage()
View of Resources wanted and consumed by the entity
|
int |
getTotalRequiredResources(org.apache.hadoop.yarn.api.records.Priority priority) |
boolean |
getUnmanagedAM() |
String |
getUser() |
boolean |
hasPendingResourceRequest(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc,
String nodePartition,
org.apache.hadoop.yarn.api.records.Resource cluster,
SchedulingMode schedulingMode) |
void |
incNumAllocatedContainers(NodeType containerType,
NodeType requestType) |
void |
increaseContainer(SchedContainerChangeRequest increaseRequest) |
boolean |
isAmRunning() |
boolean |
isPending()
Is this application pending?
|
boolean |
isPlaceBlacklisted(String resourceName) |
boolean |
isRecovering()
Whether application was running before RM restart.
|
boolean |
isReserved(SchedulerNode node,
org.apache.hadoop.yarn.api.records.Priority priority)
Has the application reserved the given
node at the
given priority ? |
boolean |
isStopped() |
boolean |
isWaitingForAMContainer() |
void |
move(Queue newQueue) |
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyAllocatedContainers() |
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyDecreasedContainers() |
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyIncreasedContainers() |
List<org.apache.hadoop.yarn.api.records.NMToken> |
pullUpdatedNMTokens() |
void |
recordContainerAllocationTime(long value) |
void |
recordContainerRequestTime(long value) |
void |
recoverContainer(SchedulerNode node,
RMContainer rmContainer) |
void |
recoverResourceRequestsForContainer(List<org.apache.hadoop.yarn.api.records.ResourceRequest> requests) |
boolean |
removeIncreaseRequest(org.apache.hadoop.yarn.api.records.NodeId nodeId,
org.apache.hadoop.yarn.api.records.Priority priority,
org.apache.hadoop.yarn.api.records.ContainerId containerId) |
RMContainer |
reserve(SchedulerNode node,
org.apache.hadoop.yarn.api.records.Priority priority,
RMContainer rmContainer,
org.apache.hadoop.yarn.api.records.Container container) |
boolean |
reserveIncreasedContainer(SchedulerNode node,
org.apache.hadoop.yarn.api.records.Priority priority,
RMContainer rmContainer,
org.apache.hadoop.yarn.api.records.Resource reservedResource) |
void |
resetMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority) |
protected void |
resetReReservations(org.apache.hadoop.yarn.api.records.Priority priority) |
void |
resetSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority)
Should be called when an application has successfully scheduled a container,
or when the scheduling locality threshold is relaxed.
|
void |
resetSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority,
long currentTimeMs) |
void |
setAMResource(org.apache.hadoop.yarn.api.records.Resource amResource) |
void |
setAMResource(String label,
org.apache.hadoop.yarn.api.records.Resource amResource) |
void |
setAmRunning(boolean bool) |
void |
setAppAMNodePartitionName(String partitionName) |
void |
setApplicationHeadroomForMetrics(org.apache.hadoop.yarn.api.records.Resource headroom) |
protected void |
setAttemptRecovering(boolean isRecovering) |
void |
setHeadroom(org.apache.hadoop.yarn.api.records.Resource globalLimit) |
void |
setPriority(org.apache.hadoop.yarn.api.records.Priority appPriority) |
void |
showRequests() |
void |
stop(RMAppAttemptState rmAppAttemptFinalState) |
void |
subtractSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority) |
void |
transferStateFromPreviousAttempt(SchedulerApplicationAttempt appAttempt) |
void |
updateAMContainerDiagnostics(SchedulerApplicationAttempt.AMState state,
String diagnosticMessage) |
void |
updateBlacklist(List<String> blacklistAdditions,
List<String> blacklistRemovals) |
boolean |
updateIncreaseRequests(List<SchedContainerChangeRequest> increaseRequests) |
boolean |
updateResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> requests) |
protected long lastMemoryAggregateAllocationUpdateTime
protected final AppSchedulingInfo appSchedulingInfo
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptId attemptId
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> liveContainers
protected final Map<org.apache.hadoop.yarn.api.records.Priority,Map<org.apache.hadoop.yarn.api.records.NodeId,RMContainer>> reservedContainers
protected ResourceUsage attemptResourceUsage
protected List<RMContainer> newlyAllocatedContainers
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> newlyDecreasedContainers
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> newlyIncreasedContainers
protected Set<org.apache.hadoop.yarn.api.records.NMToken> updatedNMTokens
protected Map<org.apache.hadoop.yarn.api.records.Priority,Long> lastScheduledContainer
protected Queue queue
protected boolean isStopped
protected String appAMNodePartitionName
protected final RMContext rmContext
public SchedulerApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, ActiveUsersManager activeUsersManager, RMContext rmContext)
public Collection<RMContainer> getLiveContainers()
public AppSchedulingInfo getAppSchedulingInfo()
public boolean isPending()
public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()
ApplicationAttemptId
of the application master.ApplicationAttemptId
of the application masterpublic org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
public String getUser()
public Map<String,org.apache.hadoop.yarn.api.records.ResourceRequest> getResourceRequests(org.apache.hadoop.yarn.api.records.Priority priority)
public Set<org.apache.hadoop.yarn.api.records.ContainerId> getPendingRelease()
public long getNewContainerId()
public Collection<org.apache.hadoop.yarn.api.records.Priority> getPriorities()
public org.apache.hadoop.yarn.api.records.ResourceRequest getResourceRequest(org.apache.hadoop.yarn.api.records.Priority priority, String resourceName)
public int getTotalRequiredResources(org.apache.hadoop.yarn.api.records.Priority priority)
public org.apache.hadoop.yarn.api.records.Resource getResource(org.apache.hadoop.yarn.api.records.Priority priority)
public String getQueueName()
public org.apache.hadoop.yarn.api.records.Resource getAMResource()
public org.apache.hadoop.yarn.api.records.Resource getAMResource(String label)
public void setAMResource(org.apache.hadoop.yarn.api.records.Resource amResource)
public void setAMResource(String label, org.apache.hadoop.yarn.api.records.Resource amResource)
public boolean isAmRunning()
public void setAmRunning(boolean bool)
public boolean getUnmanagedAM()
public RMContainer getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId id)
protected void resetReReservations(org.apache.hadoop.yarn.api.records.Priority priority)
protected void addReReservation(org.apache.hadoop.yarn.api.records.Priority priority)
public int getReReservations(org.apache.hadoop.yarn.api.records.Priority priority)
@InterfaceStability.Stable @InterfaceAudience.Private public org.apache.hadoop.yarn.api.records.Resource getCurrentReservation()
public Queue getQueue()
public boolean updateResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> requests)
public void recoverResourceRequestsForContainer(List<org.apache.hadoop.yarn.api.records.ResourceRequest> requests)
public void stop(RMAppAttemptState rmAppAttemptFinalState)
public boolean isStopped()
public List<RMContainer> getReservedContainers()
public boolean reserveIncreasedContainer(SchedulerNode node, org.apache.hadoop.yarn.api.records.Priority priority, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Resource reservedResource)
public RMContainer reserve(SchedulerNode node, org.apache.hadoop.yarn.api.records.Priority priority, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Container container)
public boolean isReserved(SchedulerNode node, org.apache.hadoop.yarn.api.records.Priority priority)
node
at the
given priority
?node
- node to be checkedpriority
- priority of reserved containerpublic void setHeadroom(org.apache.hadoop.yarn.api.records.Resource globalLimit)
public org.apache.hadoop.yarn.api.records.Resource getHeadroom()
public int getNumReservedContainers(org.apache.hadoop.yarn.api.records.Priority priority)
public void containerLaunchedOnNode(org.apache.hadoop.yarn.api.records.ContainerId containerId, org.apache.hadoop.yarn.api.records.NodeId nodeId)
public void showRequests()
public org.apache.hadoop.yarn.api.records.Resource getCurrentConsumption()
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyAllocatedContainers()
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyIncreasedContainers()
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyDecreasedContainers()
public List<org.apache.hadoop.yarn.api.records.NMToken> pullUpdatedNMTokens()
public boolean isWaitingForAMContainer()
public void updateBlacklist(List<String> blacklistAdditions, List<String> blacklistRemovals)
public boolean isPlaceBlacklisted(String resourceName)
public int addMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority)
public void resetMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority)
public void addSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority)
public void subtractSchedulingOpportunity(org.apache.hadoop.yarn.api.records.Priority priority)
public int getSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority)
public void resetSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority)
priority
- The priority of the container scheduled.public void resetSchedulingOpportunities(org.apache.hadoop.yarn.api.records.Priority priority, long currentTimeMs)
public org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getResourceUsageReport()
public Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> getLiveContainersMap()
public org.apache.hadoop.yarn.api.records.Resource getResourceLimit()
public Map<org.apache.hadoop.yarn.api.records.Priority,Long> getLastScheduledContainer()
public void transferStateFromPreviousAttempt(SchedulerApplicationAttempt appAttempt)
public void move(Queue newQueue)
public void recoverContainer(SchedulerNode node, RMContainer rmContainer)
public void incNumAllocatedContainers(NodeType containerType, NodeType requestType)
public void setApplicationHeadroomForMetrics(org.apache.hadoop.yarn.api.records.Resource headroom)
public void recordContainerRequestTime(long value)
public void recordContainerAllocationTime(long value)
@InterfaceAudience.Private public boolean hasPendingResourceRequest(org.apache.hadoop.yarn.util.resource.ResourceCalculator rc, String nodePartition, org.apache.hadoop.yarn.api.records.Resource cluster, SchedulingMode schedulingMode)
public ResourceUsage getAppAttemptResourceUsage()
public org.apache.hadoop.yarn.api.records.Priority getPriority()
SchedulableEntity
getPriority
in interface SchedulableEntity
public void setPriority(org.apache.hadoop.yarn.api.records.Priority appPriority)
public String getId()
SchedulableEntity
getId
in interface SchedulableEntity
public int compareInputOrderTo(SchedulableEntity other)
SchedulableEntity
compareInputOrderTo
in interface SchedulableEntity
public ResourceUsage getSchedulingResourceUsage()
SchedulableEntity
getSchedulingResourceUsage
in interface SchedulableEntity
public boolean removeIncreaseRequest(org.apache.hadoop.yarn.api.records.NodeId nodeId, org.apache.hadoop.yarn.api.records.Priority priority, org.apache.hadoop.yarn.api.records.ContainerId containerId)
public boolean updateIncreaseRequests(List<SchedContainerChangeRequest> increaseRequests)
public void decreaseContainer(SchedContainerChangeRequest decreaseRequest)
public void increaseContainer(SchedContainerChangeRequest increaseRequest)
public void setAppAMNodePartitionName(String partitionName)
public String getAppAMNodePartitionName()
public void updateAMContainerDiagnostics(SchedulerApplicationAttempt.AMState state, String diagnosticMessage)
protected void getPendingAppDiagnosticMessage(StringBuilder diagnosticMessage)
protected void getActivedAppDiagnosticMessage(StringBuilder diagnosticMessage)
public boolean isRecovering()
SchedulableEntity
isRecovering
in interface SchedulableEntity
protected void setAttemptRecovering(boolean isRecovering)
Copyright © 2017 Apache Software Foundation. All Rights Reserved.