@InterfaceAudience.Private @InterfaceStability.Unstable public class SchedulerApplicationAttempt extends Object implements SchedulableEntity
Modifier and Type | Class and Description |
---|---|
static class |
SchedulerApplicationAttempt.AMState
Different state for Application Master, user can see this state from web UI
|
Modifier and Type | Field and Description |
---|---|
protected String |
appAMNodePartitionName |
protected AppSchedulingInfo |
appSchedulingInfo |
protected org.apache.hadoop.yarn.api.records.ApplicationAttemptId |
attemptId |
protected ResourceUsage |
attemptOpportunisticResourceUsage
Resource usage of opportunistic containers.
|
protected ResourceUsage |
attemptResourceUsage |
protected ResourceUsage |
attemptResourceUsageAllocatedRemotely
Scheduled by a remote scheduler.
|
protected boolean |
isStopped |
protected long |
lastMemoryAggregateAllocationUpdateTime |
protected Map<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey,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> |
newlyDemotedContainers |
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
newlyIncreasedContainers |
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> |
newlyPromotedContainers |
protected Queue |
queue |
protected ReentrantReadWriteLock.ReadLock |
readLock |
protected Map<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey,Map<org.apache.hadoop.yarn.api.records.NodeId,RMContainer>> |
reservedContainers |
protected RMContext |
rmContext |
protected List<RMContainer> |
tempContainerToKill |
protected List<org.apache.hadoop.yarn.api.records.UpdateContainerError> |
updateContainerErrors |
protected Set<org.apache.hadoop.yarn.api.records.NMToken> |
updatedNMTokens |
protected ReentrantReadWriteLock.WriteLock |
writeLock |
Constructor and Description |
---|
SchedulerApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId,
String user,
Queue queue,
AbstractUsersManager abstractUsersManager,
RMContext rmContext) |
Modifier and Type | Method and Description |
---|---|
int |
addMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
protected void |
addReReservation(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
void |
addRMContainer(org.apache.hadoop.yarn.api.records.ContainerId id,
RMContainer rmContainer) |
void |
addSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
protected void |
addToNewlyAllocatedContainers(SchedulerNode node,
RMContainer rmContainer) |
void |
addToNewlyDecreasedContainers(org.apache.hadoop.yarn.api.records.ContainerId containerId,
RMContainer rmContainer) |
void |
addToNewlyDemotedContainers(org.apache.hadoop.yarn.api.records.ContainerId containerId,
RMContainer rmContainer) |
protected void |
addToUpdateContainerErrors(org.apache.hadoop.yarn.api.records.UpdateContainerError error) |
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 |
decUnconfirmedRes(org.apache.hadoop.yarn.api.records.Resource res) |
boolean |
equals(Object o) |
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() |
Map<String,String> |
getApplicationSchedulingEnvs() |
<N extends SchedulerNode> |
getAppPlacementAllocator(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey) |
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.server.scheduler.SchedulerRequestKey,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.server.scheduler.SchedulerRequestKey schedulerKey) |
org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext |
getOpportunisticContainerContext() |
int |
getOutstandingAsksCount(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
int |
getOutstandingAsksCount(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey,
String resourceName) |
String |
getPartition()
Get partition corresponding to this entity.
|
protected void |
getPendingAppDiagnosticMessage(StringBuilder diagnosticMessage) |
PendingAsk |
getPendingAsk(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey,
String resourceName) |
Set<org.apache.hadoop.yarn.api.records.ContainerId> |
getPendingRelease() |
org.apache.hadoop.yarn.api.records.Priority |
getPriority()
Get the priority of the application
|
Queue |
getQueue() |
String |
getQueueName() |
int |
getReReservations(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
List<RMContainer> |
getReservedContainers()
Get the list of reserved containers
|
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport |
getResourceUsageReport() |
RMContainer |
getRMContainer(org.apache.hadoop.yarn.api.records.ContainerId id) |
Collection<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey> |
getSchedulerKeys() |
int |
getSchedulingOpportunities(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
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
|
long |
getStartTime()
Start time of the job.
|
boolean |
getUnmanagedAM() |
ContainerUpdateContext |
getUpdateContext() |
String |
getUser() |
ReentrantReadWriteLock.WriteLock |
getWriteLock() |
int |
hashCode() |
boolean |
hasPendingResourceRequest(String nodePartition,
SchedulingMode schedulingMode) |
void |
incNumAllocatedContainers(NodeType containerType,
NodeType requestType) |
void |
incUnconfirmedRes(org.apache.hadoop.yarn.api.records.Resource res) |
boolean |
isAmRunning() |
boolean |
isPending()
Is this application pending?
|
boolean |
isPlaceBlacklisted(String resourceName) |
boolean |
isRecovering()
Whether application was running before RM restart.
|
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> |
pullNewlyDemotedContainers() |
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyIncreasedContainers() |
List<org.apache.hadoop.yarn.api.records.Container> |
pullNewlyPromotedContainers() |
List<org.apache.hadoop.yarn.api.records.Container> |
pullPreviousAttemptContainers()
Called when AM heartbeats.
|
List<org.apache.hadoop.yarn.api.records.UpdateContainerError> |
pullUpdateContainerErrors() |
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(ContainerRequest containerRequest) |
void |
removeRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId) |
RMContainer |
reserve(SchedulerNode node,
org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey,
RMContainer rmContainer,
org.apache.hadoop.yarn.api.records.Container container) |
boolean |
reserveIncreasedContainer(SchedulerNode node,
org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey,
RMContainer rmContainer,
org.apache.hadoop.yarn.api.records.Resource reservedResource) |
void |
resetMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
protected void |
resetReReservations(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
void |
resetSchedulingOpportunities(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
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.server.scheduler.SchedulerRequestKey schedulerKey,
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 |
setOpportunisticContainerContext(org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext oppContext) |
void |
setPriority(org.apache.hadoop.yarn.api.records.Priority appPriority) |
void |
showRequests() |
void |
stop(RMAppAttemptState rmAppAttemptFinalState) |
void |
subtractSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey) |
void |
transferStateFromPreviousAttempt(SchedulerApplicationAttempt appAttempt) |
void |
updateAMContainerDiagnostics(SchedulerApplicationAttempt.AMState state,
String diagnosticMessage) |
void |
updateBlacklist(List<String> blacklistAdditions,
List<String> blacklistRemovals) |
void |
updateNMTokens(Collection<org.apache.hadoop.yarn.api.records.Container> containers) |
boolean |
updateResourceRequests(List<org.apache.hadoop.yarn.api.records.ResourceRequest> requests) |
boolean |
updateSchedulingRequests(List<org.apache.hadoop.yarn.api.records.SchedulingRequest> 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.server.scheduler.SchedulerRequestKey,Map<org.apache.hadoop.yarn.api.records.NodeId,RMContainer>> reservedContainers
protected ResourceUsage attemptResourceUsage
protected ResourceUsage attemptOpportunisticResourceUsage
protected ResourceUsage attemptResourceUsageAllocatedRemotely
protected List<RMContainer> newlyAllocatedContainers
protected List<RMContainer> tempContainerToKill
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> newlyPromotedContainers
protected Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> newlyDemotedContainers
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 List<org.apache.hadoop.yarn.api.records.UpdateContainerError> updateContainerErrors
protected Map<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey,Long> lastScheduledContainer
protected volatile Queue queue
protected volatile boolean isStopped
protected String appAMNodePartitionName
protected final RMContext rmContext
protected ReentrantReadWriteLock.ReadLock readLock
protected ReentrantReadWriteLock.WriteLock writeLock
public SchedulerApplicationAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, Queue queue, AbstractUsersManager abstractUsersManager, RMContext rmContext)
public void setOpportunisticContainerContext(org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext oppContext)
public org.apache.hadoop.yarn.server.scheduler.OpportunisticContainerContext getOpportunisticContainerContext()
public Collection<RMContainer> getLiveContainers()
public AppSchedulingInfo getAppSchedulingInfo()
public ContainerUpdateContext getUpdateContext()
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 Set<org.apache.hadoop.yarn.api.records.ContainerId> getPendingRelease()
public long getNewContainerId()
public Collection<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey> getSchedulerKeys()
public PendingAsk getPendingAsk(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, String resourceName)
public int getOutstandingAsksCount(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
public int getOutstandingAsksCount(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, String resourceName)
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)
public void addRMContainer(org.apache.hadoop.yarn.api.records.ContainerId id, RMContainer rmContainer)
public void removeRMContainer(org.apache.hadoop.yarn.api.records.ContainerId containerId)
protected void resetReReservations(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
protected void addReReservation(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
public int getReReservations(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
@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 boolean updateSchedulingRequests(List<org.apache.hadoop.yarn.api.records.SchedulingRequest> requests)
public void recoverResourceRequestsForContainer(ContainerRequest containerRequest)
public void stop(RMAppAttemptState rmAppAttemptFinalState)
public boolean isStopped()
public List<RMContainer> getReservedContainers()
public boolean reserveIncreasedContainer(SchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Resource reservedResource)
public RMContainer reserve(SchedulerNode node, org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, RMContainer rmContainer, org.apache.hadoop.yarn.api.records.Container container)
public 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.server.scheduler.SchedulerRequestKey schedulerKey)
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 void updateNMTokens(Collection<org.apache.hadoop.yarn.api.records.Container> containers)
public List<org.apache.hadoop.yarn.api.records.Container> pullPreviousAttemptContainers()
AllocateResponse#containersFromPreviousAttempts
.public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyAllocatedContainers()
public void addToNewlyDemotedContainers(org.apache.hadoop.yarn.api.records.ContainerId containerId, RMContainer rmContainer)
public void addToNewlyDecreasedContainers(org.apache.hadoop.yarn.api.records.ContainerId containerId, RMContainer rmContainer)
protected void addToUpdateContainerErrors(org.apache.hadoop.yarn.api.records.UpdateContainerError error)
protected void addToNewlyAllocatedContainers(SchedulerNode node, RMContainer rmContainer)
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyPromotedContainers()
public List<org.apache.hadoop.yarn.api.records.Container> pullNewlyDemotedContainers()
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.UpdateContainerError> pullUpdateContainerErrors()
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.server.scheduler.SchedulerRequestKey schedulerKey)
public void resetMissedNonPartitionedRequestSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
public void addSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
public void subtractSchedulingOpportunity(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
public int getSchedulingOpportunities(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
schedulerKey
- Scheduler Keypublic void resetSchedulingOpportunities(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey)
schedulerKey
- The priority of the container scheduled.public void resetSchedulingOpportunities(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerKey, long currentTimeMs)
public org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getResourceUsageReport()
public Map<org.apache.hadoop.yarn.api.records.ContainerId,RMContainer> getLiveContainersMap()
public Map<org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey,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(String nodePartition, 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 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 ReentrantReadWriteLock.WriteLock getWriteLock()
public boolean isRecovering()
SchedulableEntity
isRecovering
in interface SchedulableEntity
protected void setAttemptRecovering(boolean isRecovering)
public <N extends SchedulerNode> AppPlacementAllocator<N> getAppPlacementAllocator(org.apache.hadoop.yarn.server.scheduler.SchedulerRequestKey schedulerRequestKey)
public void incUnconfirmedRes(org.apache.hadoop.yarn.api.records.Resource res)
public void decUnconfirmedRes(org.apache.hadoop.yarn.api.records.Resource res)
public String getPartition()
SchedulableEntity
getPartition
in interface SchedulableEntity
public long getStartTime()
SchedulableEntity
getStartTime
in interface SchedulableEntity
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.