org.apache.hadoop.yarn.server.resourcemanager.rmapp
Interface RMApp

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 Summary
 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.
 org.apache.hadoop.yarn.api.records.YarnApplicationState createApplicationState()
          Create the external user-facing state of ApplicationMaster from the current state of the RMApp.
 Map<org.apache.hadoop.yarn.api.records.ApplicationAttemptId,RMAppAttempt> getAppAttempts()
          RMApp can have multiple application attempts RMAppAttempt.
 org.apache.hadoop.yarn.api.records.ApplicationId getApplicationId()
          The application id for this RMApp.
 org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getApplicationSubmissionContext()
          The application submission context for this RMApp
 String getApplicationType()
          Returns the application type
 RMAppAttempt getCurrentAppAttempt()
          RMApp can have multiple application attempts RMAppAttempt.
 StringBuilder getDiagnostics()
          the diagnostics information for the application master.
 org.apache.hadoop.yarn.api.records.FinalApplicationStatus getFinalApplicationStatus()
          The final finish state of the AM when unregistering as in FinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus).
 long getFinishTime()
          The finish time of the RMApp
 int getMaxAppAttempts()
          The number of max attempts of the application.
 String getName()
          The name of the application as set in ApplicationSubmissionContext.setApplicationName(String).
 float getProgress()
          Progress of application.
 String getQueue()
          Each Application is submitted to a queue decided by ApplicationSubmissionContext.setQueue(String).
 RMAppAttempt getRMAppAttempt(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId)
          RMApp can have multiple application attempts RMAppAttempt.
 long getStartTime()
          the start time of the application.
 RMAppState getState()
          The current state of the RMApp.
 long getSubmitTime()
          the submit time of the application.
 String getTrackingUrl()
          The tracking url for the application master.
 String getUser()
          The user who submitted this application.
 boolean isAppSafeToUnregister()
          Check whether this application is safe to unregister.
 int pullRMNodeUpdates(Collection<RMNode> updatedNodes)
          To receive the collection of all RMNodes whose updates have been received by the RMApp.
 void setQueue(String name)
          Reflects a change in the application's queue from the one specified in the ApplicationSubmissionContext.
 
Methods inherited from interface org.apache.hadoop.yarn.event.EventHandler
handle
 

Method Detail

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:

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(Collection<RMNode> 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 - Collection into which the updates are transferred
Returns:
the number of nodes added to the Collection

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.

getTrackingUrl

String getTrackingUrl()
The tracking url for the application master.

Returns:
the 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.

isAppSafeToUnregister

boolean isAppSafeToUnregister()
Check whether this application is safe to unregister. An application is deemed to be safe to unregister if it is an unmanaged AM or its state has been removed from state store.

Returns:
the flag which indicates whether this application is safe to unregister.

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.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.