All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<RMAppAttemptEvent>
All Known Implementing Classes:
RMAppAttemptImpl

public interface RMAppAttempt extends org.apache.hadoop.yarn.event.EventHandler<RMAppAttemptEvent>
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 Details

    • getAppAttemptId

      org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAppAttemptId()
      Get the application attempt id for this RMAppAttempt.
      Returns:
      the ApplicationAttemptId for this RM attempt.
    • getAppAttemptState

      RMAppAttemptState getAppAttemptState()
      The state of the RMAppAttempt.
      Returns:
      the state RMAppAttemptState of this RMAppAttempt
    • getHost

      String getHost()
      The host on which the RMAppAttempt is running/ran on.
      Returns:
      the host on which the RMAppAttempt ran/is running on.
    • getRpcPort

      int getRpcPort()
      The rpc port of the RMAppAttempt.
      Returns:
      the rpc port of the RMAppAttempt to 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 Container on which the application master is running.
    • getSubmissionContext

      org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getSubmissionContext()
      The application submission context for this RMAppAttempt.
      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

      @LimitedPrivate("RMStateStore") SecretKey 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 the BlacklistManager that manages blacklists for AM failures
      Returns:
      the BlacklistManager that 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 the RMAppAttempt.
      Returns:
      the current state RMAppAttemptState for this application attempt.
    • getPreviousState

      RMAppAttemptState getPreviousState()
      The previous state of the RMAppAttempt before the current state.
      Returns:
      the previous state of the RMAppAttempt before 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 the RMAppAttempt.
      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 the RMAppAttempt
      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 the RMAppAttempt
      Returns:
      metrics
    • getFinishTime

      long getFinishTime()
      the finish time of the application attempt.
      Returns:
      the finish time of the application attempt.
    • updateAMLaunchDiagnostics

      void updateAMLaunchDiagnostics(String amLaunchDiagnostics)
      To capture Launch diagnostics of the app.
      Parameters:
      amLaunchDiagnostics - amLaunchDiagnostics.
    • getBlacklistedNodes

      Set<String> getBlacklistedNodes()
      Returns:
      Set of nodes which are blacklisted by the application