All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<RMAppEvent>
All Known Implementing Classes:
RMAppImpl

public interface RMApp extends org.apache.hadoop.yarn.event.EventHandler<RMAppEvent>
The interface to an Application in the ResourceManager. Take a look at RMAppImpl for its implementation. This interface exposes methods to access various updates in application status/report.
  • Method Details

    • getApplicationId

      org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
      The application id for this RMApp.
      Returns:
      the ApplicationId for this RMApp.
    • getApplicationSubmissionContext

      org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getApplicationSubmissionContext()
      The application submission context for this RMApp
      Returns:
      the ApplicationSubmissionContext for this RMApp
    • getState

      RMAppState getState()
      The current state of the RMApp.
      Returns:
      the current state RMAppState for this application.
    • getUser

      String getUser()
      The user who submitted this application.
      Returns:
      the user who submitted the application.
    • getProgress

      float getProgress()
      Progress of application.
      Returns:
      the progress of the RMApp.
    • getRMAppAttempt

      RMAppAttempt getRMAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
      RMApp can have multiple application attempts RMAppAttempt. This method returns the RMAppAttempt corresponding to ApplicationAttemptId.
      Parameters:
      appAttemptId - the application attempt id
      Returns:
      the RMAppAttempt corresponding to the ApplicationAttemptId.
    • getQueue

      String getQueue()
      Each Application is submitted to a queue decided by ApplicationSubmissionContext.setQueue(String). This method returns the queue to which an application was submitted.
      Returns:
      the queue to which the application was submitted to.
    • setQueue

      void setQueue(String name)
      Reflects a change in the application's queue from the one specified in the ApplicationSubmissionContext.
      Parameters:
      name - the new queue name
    • getName

      String getName()
      The name of the application as set in ApplicationSubmissionContext.setApplicationName(String).
      Returns:
      the name of the application.
    • getCurrentAppAttempt

      RMAppAttempt getCurrentAppAttempt()
      RMApp can have multiple application attempts RMAppAttempt. This method returns the current RMAppAttempt.
      Returns:
      the current RMAppAttempt
    • getAppAttempts

      Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,RMAppAttempt> getAppAttempts()
      RMApp can have multiple application attempts RMAppAttempt. This method returns the all RMAppAttempts for the RMApp.
      Returns:
      all RMAppAttempts for the RMApp.
    • createAndGetApplicationReport

      org.apache.hadoop.yarn.api.records.ApplicationReport createAndGetApplicationReport(String clientUserName, boolean allowAccess)
      To get the status of an application in the RM, this method can be used. If full access is not allowed then the following fields in the report will be stubbed:
      • host - set to "N/A"
      • RPC port - set to -1
      • client token - set to "N/A"
      • diagnostics - set to "N/A"
      • tracking URL - set to "N/A"
      • original tracking URL - set to "N/A"
      • resource usage report - all values are -1
      Parameters:
      clientUserName - the user name of the client requesting the report
      allowAccess - whether to allow full access to the report
      Returns:
      the ApplicationReport detailing the status of the application.
    • pullRMNodeUpdates

      int pullRMNodeUpdates(Map<RMNode,org.apache.hadoop.yarn.api.records.NodeUpdateType> updatedNodes)
      To receive the collection of all RMNodes whose updates have been received by the RMApp. Updates can be node becoming lost or becoming healthy etc. The method clears the information from the RMApp. So each call to this method gives the delta from the previous call.
      Parameters:
      updatedNodes - Map into which the updates are transferred, with each node updates as the key, and the NodeUpdateType for that update as the corresponding value.
      Returns:
      the number of nodes added to the Map
    • getFinishTime

      long getFinishTime()
      The finish time of the RMApp
      Returns:
      the finish time of the application.,
    • getStartTime

      long getStartTime()
      the start time of the application.
      Returns:
      the start time of the application.
    • getSubmitTime

      long getSubmitTime()
      the submit time of the application.
      Returns:
      the submit time of the application.
    • getLaunchTime

      long getLaunchTime()
      The launch time of the application. Since getStartTime() returns what is essentially submit time, this new field is to prevent potential backwards compatibility issues.
      Returns:
      the launch time of the application.
    • getTrackingUrl

      String getTrackingUrl()
      The tracking url for the application master.
      Returns:
      the tracking url for the application master.
    • getCollectorData

      @Private @Unstable org.apache.hadoop.yarn.server.api.records.AppCollectorData getCollectorData()
      The timeline collector information for the application. It should be used only if the timeline service v.2 is enabled.
      Returns:
      the data for the application's collector, including collector address, RM ID, version and collector token. Return null if the timeline service v.2 is not enabled.
    • getCollectorInfo

      @Private @Unstable org.apache.hadoop.yarn.api.records.CollectorInfo getCollectorInfo()
      The timeline collector information to be sent to AM. It should be used only if the timeline service v.2 is enabled.
      Returns:
      collector info, including collector address and collector token. Return null if the timeline service v.2 is not enabled.
    • getOriginalTrackingUrl

      String getOriginalTrackingUrl()
      The original tracking url for the application master.
      Returns:
      the original tracking url for the application master.
    • getDiagnostics

      StringBuilder getDiagnostics()
      the diagnostics information for the application master.
      Returns:
      the diagnostics information for the application master.
    • getFinalApplicationStatus

      org.apache.hadoop.yarn.api.records.FinalApplicationStatus getFinalApplicationStatus()
      The final finish state of the AM when unregistering as in FinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus).
      Returns:
      the final finish state of the AM as set in FinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus).
    • getMaxAppAttempts

      int getMaxAppAttempts()
      The number of max attempts of the application.
      Returns:
      the number of max attempts of the application.
    • getApplicationType

      String getApplicationType()
      Returns the application type
      Returns:
      the application type.
    • getApplicationTags

      Set<String> getApplicationTags()
      Get tags for the application
      Returns:
      tags corresponding to the application
    • isAppFinalStateStored

      boolean isAppFinalStateStored()
      Check whether this application's state has been saved to the state store.
      Returns:
      the flag indicating whether the applications's state is stored.
    • getRanNodes

      Set<org.apache.hadoop.yarn.api.records.NodeId> getRanNodes()
      Nodes on which the containers for this RMApp ran.
      Returns:
      the set of nodes that ran any containers from this RMApp Add more node on which containers for this RMApp ran
    • createApplicationState

      org.apache.hadoop.yarn.api.records.YarnApplicationState createApplicationState()
      Create the external user-facing state of ApplicationMaster from the current state of the RMApp.
      Returns:
      the external user-facing state of ApplicationMaster.
    • getRMAppMetrics

      RMAppMetrics getRMAppMetrics()
      Get RMAppMetrics of the RMApp.
      Returns:
      metrics
    • getReservationId

      org.apache.hadoop.yarn.api.records.ReservationId getReservationId()
    • getAMResourceRequests

      List<org.apache.hadoop.yarn.api.records.ResourceRequest> getAMResourceRequests()
    • getLogAggregationReportsForApp

      Map<org.apache.hadoop.yarn.api.records.NodeId,org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport> getLogAggregationReportsForApp()
    • getLogAggregationStatusForAppReport

      org.apache.hadoop.yarn.api.records.LogAggregationStatus getLogAggregationStatusForAppReport()
    • getAmNodeLabelExpression

      String getAmNodeLabelExpression()
      Return the node label expression of the AM container.
      Returns:
      the node label expression.
    • getAppNodeLabelExpression

      String getAppNodeLabelExpression()
    • getCallerContext

      org.apache.hadoop.ipc.CallerContext getCallerContext()
    • getApplicationTimeouts

      Map<org.apache.hadoop.yarn.api.records.ApplicationTimeoutType,Long> getApplicationTimeouts()
    • getApplicationPriority

      org.apache.hadoop.yarn.api.records.Priority getApplicationPriority()
      Get priority of the application.
      Returns:
      priority
    • isAppInCompletedStates

      boolean isAppInCompletedStates()
      To verify whether app has reached in its completing/completed states.
      Returns:
      True/False to confirm whether app is in final states
    • getApplicationPlacementContext

      ApplicationPlacementContext getApplicationPlacementContext()
      Get the application -> queue placement context
      Returns:
      ApplicationPlacementContext
    • getApplicationSchedulingEnvs

      Map<String,String> getApplicationSchedulingEnvs()
      Get the application scheduling environment variables.
      Returns:
      Map of envs related to application scheduling preferences.
    • getRealUser

      String getRealUser()