Interface RMApp
- All Superinterfaces:
org.apache.hadoop.yarn.event.EventHandler<RMAppEvent>
- All Known Implementing Classes:
RMAppImpl
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 Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.yarn.api.records.ApplicationReportcreateAndGetApplicationReport(String clientUserName, boolean allowAccess) To get the status of an application in the RM, this method can be used.org.apache.hadoop.yarn.api.records.YarnApplicationStateCreate the external user-facing state of ApplicationMaster from the current state of theRMApp.Return the node label expression of the AM container.List<org.apache.hadoop.yarn.api.records.ResourceRequest>Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,RMAppAttempt> RMAppcan have multiple application attemptsRMAppAttempt.org.apache.hadoop.yarn.api.records.ApplicationIdThe application id for thisRMApp.Get the application -> queue placement contextorg.apache.hadoop.yarn.api.records.PriorityGet priority of the application.Get the application scheduling environment variables.org.apache.hadoop.yarn.api.records.ApplicationSubmissionContextThe application submission context for thisRMAppGet tags for the applicationReturns the application typeorg.apache.hadoop.ipc.CallerContextorg.apache.hadoop.yarn.server.api.records.AppCollectorDataThe timeline collector information for the application.org.apache.hadoop.yarn.api.records.CollectorInfoThe timeline collector information to be sent to AM.RMAppcan have multiple application attemptsRMAppAttempt.the diagnostics information for the application master.org.apache.hadoop.yarn.api.records.FinalApplicationStatusThe final finish state of the AM when unregistering as inFinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus).longThe finish time of theRMApplongThe launch time of the application.Map<org.apache.hadoop.yarn.api.records.NodeId,org.apache.hadoop.yarn.server.api.protocolrecords.LogAggregationReport> org.apache.hadoop.yarn.api.records.LogAggregationStatusintThe number of max attempts of the application.getName()The name of the application as set inApplicationSubmissionContext.setApplicationName(String).The original tracking url for the application master.floatProgress of application.getQueue()Each Application is submitted to a queue decided byApplicationSubmissionContext.setQueue(String).Set<org.apache.hadoop.yarn.api.records.NodeId>Nodes on which the containers for thisRMAppran.org.apache.hadoop.yarn.api.records.ReservationIdgetRMAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) RMAppcan have multiple application attemptsRMAppAttempt.Get RMAppMetrics of theRMApp.longthe start time of the application.getState()The current state of theRMApp.longthe submit time of the application.The tracking url for the application master.getUser()The user who submitted this application.booleanCheck whether this application's state has been saved to the state store.booleanTo verify whether app has reached in its completing/completed states.intpullRMNodeUpdates(Map<RMNode, org.apache.hadoop.yarn.api.records.NodeUpdateType> updatedNodes) To receive the collection of allRMNodes whose updates have been received by the RMApp.voidReflects a change in the application's queue from the one specified in theApplicationSubmissionContext.Methods inherited from interface org.apache.hadoop.yarn.event.EventHandler
handle
-
Method Details
-
getApplicationId
org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()The application id for thisRMApp.- Returns:
- the
ApplicationIdfor thisRMApp.
-
getApplicationSubmissionContext
org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getApplicationSubmissionContext()The application submission context for thisRMApp- Returns:
- the
ApplicationSubmissionContextfor thisRMApp
-
getState
RMAppState getState()The current state of theRMApp.- Returns:
- the current state
RMAppStatefor 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
RMAppcan have multiple application attemptsRMAppAttempt. This method returns theRMAppAttemptcorresponding toApplicationAttemptId.- Parameters:
appAttemptId- the application attempt id- Returns:
- the
RMAppAttemptcorresponding to theApplicationAttemptId.
-
getQueue
String getQueue()Each Application is submitted to a queue decided byApplicationSubmissionContext.setQueue(String). This method returns the queue to which an application was submitted.- Returns:
- the queue to which the application was submitted to.
-
setQueue
Reflects a change in the application's queue from the one specified in theApplicationSubmissionContext.- Parameters:
name- the new queue name
-
getName
String getName()The name of the application as set inApplicationSubmissionContext.setApplicationName(String).- Returns:
- the name of the application.
-
getCurrentAppAttempt
RMAppAttempt getCurrentAppAttempt()RMAppcan have multiple application attemptsRMAppAttempt. This method returns the currentRMAppAttempt.- Returns:
- the current
RMAppAttempt
-
getAppAttempts
Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,RMAppAttempt> getAppAttempts()RMAppcan have multiple application attemptsRMAppAttempt. This method returns the allRMAppAttempts 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 reportallowAccess- whether to allow full access to the report- Returns:
- the
ApplicationReportdetailing the status of the application.
-
pullRMNodeUpdates
To receive the collection of allRMNodes whose updates have been received by the RMApp. Updates can be node becoming lost or becoming healthy etc. The method clears the information from theRMApp. 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 theNodeUpdateTypefor that update as the corresponding value.- Returns:
- the number of nodes added to the
Map
-
getFinishTime
long getFinishTime()The finish time of theRMApp- 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 inFinishApplicationMasterRequest.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
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 thisRMAppran. -
createApplicationState
org.apache.hadoop.yarn.api.records.YarnApplicationState createApplicationState()Create the external user-facing state of ApplicationMaster from the current state of theRMApp.- Returns:
- the external user-facing state of ApplicationMaster.
-
getRMAppMetrics
RMAppMetrics getRMAppMetrics()Get RMAppMetrics of theRMApp.- 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
-
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
Get the application scheduling environment variables.- Returns:
- Map of envs related to application scheduling preferences.
-
getRealUser
String getRealUser()
-