public class RMAppImpl extends Object implements RMApp, Recoverable
Constructor and Description |
---|
RMAppImpl(ApplicationId applicationId,
RMContext rmContext,
Configuration config,
String name,
String user,
String queue,
ApplicationSubmissionContext submissionContext,
YarnScheduler scheduler,
ApplicationMasterService masterService,
long submitTime,
String applicationType) |
Modifier and Type | Method and Description |
---|---|
ApplicationReport |
createAndGetApplicationReport(String clientUserName,
boolean allowAccess)
To get the status of an application in the RM, this method can be used.
|
YarnApplicationState |
createApplicationState()
Create the external user-facing state of ApplicationMaster from the
current state of the
RMApp . |
Map<ApplicationAttemptId,RMAppAttempt> |
getAppAttempts()
RMApp can have multiple application attempts RMAppAttempt . |
ApplicationId |
getApplicationId()
The application id for this
RMApp . |
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.
|
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(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.
|
void |
handle(RMAppEvent event) |
boolean |
isAppSafeToUnregister()
Check whether this application is safe to unregister.
|
int |
pullRMNodeUpdates(Collection<RMNode> updatedNodes)
To receive the collection of all
RMNode s whose updates have been
received by the RMApp. |
void |
recover(RMStateStore.RMState state) |
void |
setQueue(String queue)
Reflects a change in the application's queue from the one specified in the
ApplicationSubmissionContext . |
public RMAppImpl(ApplicationId applicationId, RMContext rmContext, Configuration config, String name, String user, String queue, ApplicationSubmissionContext submissionContext, YarnScheduler scheduler, ApplicationMasterService masterService, long submitTime, String applicationType)
public ApplicationId getApplicationId()
RMApp
RMApp
.getApplicationId
in interface RMApp
ApplicationId
for this RMApp
.public ApplicationSubmissionContext getApplicationSubmissionContext()
RMApp
RMApp
getApplicationSubmissionContext
in interface RMApp
ApplicationSubmissionContext
for this RMApp
public FinalApplicationStatus getFinalApplicationStatus()
RMApp
FinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus)
.getFinalApplicationStatus
in interface RMApp
FinishApplicationMasterRequest.setFinalApplicationStatus(FinalApplicationStatus)
.public RMAppState getState()
RMApp
RMApp
.getState
in interface RMApp
RMAppState
for this application.public String getUser()
RMApp
public float getProgress()
RMApp
getProgress
in interface RMApp
RMApp
.public RMAppAttempt getRMAppAttempt(ApplicationAttemptId appAttemptId)
RMApp
RMApp
can have multiple application attempts RMAppAttempt
.
This method returns the RMAppAttempt
corresponding to
ApplicationAttemptId
.getRMAppAttempt
in interface RMApp
appAttemptId
- the application attempt idRMAppAttempt
corresponding to the ApplicationAttemptId
.public String getQueue()
RMApp
ApplicationSubmissionContext.setQueue(String)
.
This method returns the queue to which an application was submitted.public void setQueue(String queue)
RMApp
ApplicationSubmissionContext
.public String getName()
RMApp
ApplicationSubmissionContext.setApplicationName(String)
.public RMAppAttempt getCurrentAppAttempt()
RMApp
RMApp
can have multiple application attempts RMAppAttempt
.
This method returns the current RMAppAttempt
.getCurrentAppAttempt
in interface RMApp
RMAppAttempt
public Map<ApplicationAttemptId,RMAppAttempt> getAppAttempts()
RMApp
RMApp
can have multiple application attempts RMAppAttempt
.
This method returns the all RMAppAttempt
s for the RMApp.getAppAttempts
in interface RMApp
RMAppAttempt
s for the RMApp.public int pullRMNodeUpdates(Collection<RMNode> updatedNodes)
RMApp
RMNode
s 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.pullRMNodeUpdates
in interface RMApp
updatedNodes
- Collection into which the updates are transferredCollection
public ApplicationReport createAndGetApplicationReport(String clientUserName, boolean allowAccess)
RMApp
createAndGetApplicationReport
in interface RMApp
clientUserName
- the user name of the client requesting the reportallowAccess
- whether to allow full access to the reportApplicationReport
detailing the status of the application.public long getFinishTime()
RMApp
RMApp
getFinishTime
in interface RMApp
public long getStartTime()
RMApp
getStartTime
in interface RMApp
public long getSubmitTime()
RMApp
getSubmitTime
in interface RMApp
public String getTrackingUrl()
RMApp
getTrackingUrl
in interface RMApp
public StringBuilder getDiagnostics()
RMApp
getDiagnostics
in interface RMApp
public int getMaxAppAttempts()
RMApp
getMaxAppAttempts
in interface RMApp
public void handle(RMAppEvent event)
handle
in interface EventHandler<RMAppEvent>
public void recover(RMStateStore.RMState state) throws Exception
recover
in interface Recoverable
Exception
public String getApplicationType()
RMApp
getApplicationType
in interface RMApp
public boolean isAppSafeToUnregister()
RMApp
isAppSafeToUnregister
in interface RMApp
public YarnApplicationState createApplicationState()
RMApp
RMApp
.createApplicationState
in interface RMApp
Copyright © 2013 Apache Software Foundation. All rights reserved.