Interface RMAppAttempt
- All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<RMAppAttemptEvent>
- All Known Implementing Classes:
RMAppAttemptImpl
Interface to an Application Attempt in the Resource Manager.
A
RMApp can have multiple app attempts based on
YarnConfiguration.RM_AM_MAX_ATTEMPTS. For specific
implementation take a look at RMAppAttemptImpl.-
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.records.ApplicationAttemptReportCreate the Application attempt report from theRMAppAttemptorg.apache.hadoop.yarn.api.records.YarnApplicationAttemptStateCreate the external user-facing state of the attempt of ApplicationMaster from the current state of theRMAppAttempt.org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.client.ClientToAMTokenIdentifier>createClientToken(String clientName) Create a token for authenticating a client connection to the app attemptGet theBlacklistManagerthat manages blacklists for AM failuresorg.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>The AMRMToken belonging to this app attemptorg.apache.hadoop.yarn.api.records.ApplicationAttemptIdGet the application attempt id for thisRMAppAttempt.The state of theRMAppAttempt.org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReportGet application container and resource usage information.The master key for client-to-AM tokens for this app attempt.Diagnostics information for the application attempt.org.apache.hadoop.yarn.api.records.FinalApplicationStatusThe final status set by the AM.ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> The map of conatiners per Node that are already sent to the AM.longthe finish time of the application attempt.getHost()The host on which theRMAppAttemptis running/ran on.List<org.apache.hadoop.yarn.api.records.ContainerStatus>Return the list of last set of finished containers.ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> Returns a reference to the map of last set of finished containers to the corresponding node.org.apache.hadoop.yarn.api.records.ContainerThe container on which the Application Master is running.The original url at which the status of the application attempt can be accessed.The previous state of theRMAppAttemptbefore the current state.floatProgress for the application attempt.Get metrics from theRMAppAttemptintThe rpc port of theRMAppAttempt.longthe start time of the application.getState()The current state of theRMAppAttempt.org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextThe application submission context for thisRMAppAttempt.The url at which the status of the application attempt can be accessed.The base to be prepended to web URLs that are not relative, and the user has been checked.List<org.apache.hadoop.yarn.api.records.ContainerStatus>Return a list of the last set of finished containers, resetting the finished containers to empty.booleanReturn the flag which indicates whether the attempt failure should be counted to attempt retry count.voidupdateAMLaunchDiagnostics(String amLaunchDiagnostics) To capture Launch diagnostics of the app.Methods inherited from interface org.apache.hadoop.yarn.event.EventHandler
handle
-
Method Details
-
getAppAttemptId
org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAppAttemptId()Get the application attempt id for thisRMAppAttempt.- Returns:
- the
ApplicationAttemptIdfor this RM attempt.
-
getAppAttemptState
RMAppAttemptState getAppAttemptState()The state of theRMAppAttempt.- Returns:
- the state
RMAppAttemptStateof thisRMAppAttempt
-
getHost
String getHost()The host on which theRMAppAttemptis running/ran on.- Returns:
- the host on which the
RMAppAttemptran/is running on.
-
getRpcPort
int getRpcPort()The rpc port of theRMAppAttempt.- Returns:
- the rpc port of the
RMAppAttemptto which the clients can connect to.
-
getTrackingUrl
String getTrackingUrl()The url at which the status of the application attempt can be accessed.- Returns:
- the url at which the status of the attempt can be accessed.
-
getOriginalTrackingUrl
String getOriginalTrackingUrl()The original url at which the status of the application attempt can be accessed. This url is not fronted by a proxy. This is only intended to be used by the proxy.- Returns:
- the url at which the status of the attempt can be accessed and is not fronted by a proxy.
-
getWebProxyBase
String getWebProxyBase()The base to be prepended to web URLs that are not relative, and the user has been checked.- Returns:
- the base URL to be prepended to web URLs that are not relative.
-
getDiagnostics
String getDiagnostics()Diagnostics information for the application attempt.- Returns:
- diagnostics information for the application attempt.
-
getProgress
float getProgress()Progress for the application attempt.- Returns:
- the progress for this
RMAppAttempt
-
getFinalApplicationStatus
org.apache.hadoop.yarn.api.records.FinalApplicationStatus getFinalApplicationStatus()The final status set by the AM.- Returns:
- the final status that is set by the AM when unregistering itself. Can return a null if the AM has not unregistered itself.
-
pullJustFinishedContainers
List<org.apache.hadoop.yarn.api.records.ContainerStatus> pullJustFinishedContainers()Return a list of the last set of finished containers, resetting the finished containers to empty.- Returns:
- the list of just finished containers, re setting the finished containers.
-
getJustFinishedContainersReference
ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getJustFinishedContainersReference()Returns a reference to the map of last set of finished containers to the corresponding node. This does not reset the finished containers.- Returns:
- the list of just finished containers, this does not reset the finished containers.
-
getJustFinishedContainers
List<org.apache.hadoop.yarn.api.records.ContainerStatus> getJustFinishedContainers()Return the list of last set of finished containers. This does not reset the finished containers.- Returns:
- the list of just finished containers
-
getFinishedContainersSentToAMReference
ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getFinishedContainersSentToAMReference()The map of conatiners per Node that are already sent to the AM.- Returns:
- map of per node list of finished container status sent to AM
-
getMasterContainer
org.apache.hadoop.yarn.api.records.Container getMasterContainer()The container on which the Application Master is running.- Returns:
- the
Containeron which the application master is running.
-
getSubmissionContext
org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getSubmissionContext()The application submission context for thisRMAppAttempt.- Returns:
- the application submission context for this Application.
-
getAMRMToken
org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getAMRMToken()The AMRMToken belonging to this app attempt- Returns:
- The AMRMToken belonging to this app attempt
-
getClientTokenMasterKey
The master key for client-to-AM tokens for this app attempt. This is only used for RMStateStore. Normal operation must invoke the secret manager to get the key and not use the local key directly.- Returns:
- The master key for client-to-AM tokens for this app attempt
-
createClientToken
org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.client.ClientToAMTokenIdentifier> createClientToken(String clientName) Create a token for authenticating a client connection to the app attempt- Parameters:
clientName- the name of the client requesting the token- Returns:
- the token or null if the attempt is not running
-
getApplicationResourceUsageReport
org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getApplicationResourceUsageReport()Get application container and resource usage information.- Returns:
- an ApplicationResourceUsageReport object.
-
getAMBlacklistManager
BlacklistManager getAMBlacklistManager()Get theBlacklistManagerthat manages blacklists for AM failures- Returns:
- the
BlacklistManagerthat tracks AM failures.
-
getStartTime
long getStartTime()the start time of the application.- Returns:
- the start time of the application.
-
getState
RMAppAttemptState getState()The current state of theRMAppAttempt.- Returns:
- the current state
RMAppAttemptStatefor this application attempt.
-
getPreviousState
RMAppAttemptState getPreviousState()The previous state of theRMAppAttemptbefore the current state.- Returns:
- the previous state of the
RMAppAttemptbefore the current state for this application attempt.
-
createApplicationAttemptState
org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState createApplicationAttemptState()Create the external user-facing state of the attempt of ApplicationMaster from the current state of theRMAppAttempt.- Returns:
- the external user-facing state of the attempt ApplicationMaster.
-
createApplicationAttemptReport
org.apache.hadoop.yarn.api.records.ApplicationAttemptReport createApplicationAttemptReport()Create the Application attempt report from theRMAppAttempt- Returns:
ApplicationAttemptReport
-
shouldCountTowardsMaxAttemptRetry
boolean shouldCountTowardsMaxAttemptRetry()Return the flag which indicates whether the attempt failure should be counted to attempt retry count.There failure types should not be counted to attempt retry count:
- preempted by the scheduler.
- hardware failures, such as NM failing, lost NM and NM disk errors.
- killed by RM because of RM restart or failover.
- Returns:
- attempt retry count.
-
getRMAppAttemptMetrics
RMAppAttemptMetrics getRMAppAttemptMetrics()Get metrics from theRMAppAttempt- Returns:
- metrics
-
getFinishTime
long getFinishTime()the finish time of the application attempt.- Returns:
- the finish time of the application attempt.
-
updateAMLaunchDiagnostics
To capture Launch diagnostics of the app.- Parameters:
amLaunchDiagnostics- amLaunchDiagnostics.
-
getBlacklistedNodes
- Returns:
- Set of nodes which are blacklisted by the application
-