org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt
Class RMAppAttemptImpl

java.lang.Object
  extended by org.apache.hadoop.yarn.server.resourcemanager.rmapp.attempt.RMAppAttemptImpl
All Implemented Interfaces:
org.apache.hadoop.yarn.event.EventHandler<RMAppAttemptEvent>, Recoverable, RMAppAttempt

public class RMAppAttemptImpl
extends Object
implements RMAppAttempt, Recoverable


Field Summary
static org.apache.hadoop.yarn.api.records.Priority AM_CONTAINER_PRIORITY
           
 
Constructor Summary
RMAppAttemptImpl(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId, RMContext rmContext, YarnScheduler scheduler, ApplicationMasterService masterService, org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext submissionContext, org.apache.hadoop.conf.Configuration conf, String user)
           
 
Method Summary
 org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.client.ClientToAMTokenIdentifier> createClientToken(String client)
          Create a token for authenticating a client connection to the app attempt
 org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getAMRMToken()
          The AMRMToken belonging to this app attempt
 org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAppAttemptId()
          Get the application attempt id for this RMAppAttempt.
 RMAppAttemptState getAppAttemptState()
          The state of the RMAppAttempt.
 org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getApplicationResourceUsageReport()
          Get application container and resource usage information.
 SecretKey getClientTokenMasterKey()
          The master key for client-to-AM tokens for this app attempt.
 String getDiagnostics()
          Diagnostics information for the application attempt.
 org.apache.hadoop.yarn.api.records.FinalApplicationStatus getFinalApplicationStatus()
          The final status set by the AM.
 String getHost()
          The host on which the RMAppAttempt is running/ran on.
 List<org.apache.hadoop.yarn.api.records.ContainerStatus> getJustFinishedContainers()
          Return the list of last set of finished containers.
 org.apache.hadoop.yarn.api.records.Container getMasterContainer()
          The container on which the Application Master is running.
 String getOriginalTrackingUrl()
          The original url at which the status of the application attempt can be accessed.
 float getProgress()
          Progress for the application attempt.
 Set<org.apache.hadoop.yarn.api.records.NodeId> getRanNodes()
          Nodes on which the containers for this RMAppAttempt ran.
 int getRpcPort()
          The rpc port of the RMAppAttempt.
 long getStartTime()
          the start time of the application.
 org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getSubmissionContext()
          The application submission context for this RMAppAttempt.
 String getTrackingUrl()
          The url at which the status of the application attempt can be accessed.
 String getWebProxyBase()
          The base to be prepended to web URLs that are not relative, and the user has been checked.
 void handle(RMAppAttemptEvent event)
           
 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.
 void recover(RMStateStore.RMState state)
           
 void setDiagnostics(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AM_CONTAINER_PRIORITY

public static final org.apache.hadoop.yarn.api.records.Priority AM_CONTAINER_PRIORITY
Constructor Detail

RMAppAttemptImpl

public RMAppAttemptImpl(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId,
                        RMContext rmContext,
                        YarnScheduler scheduler,
                        ApplicationMasterService masterService,
                        org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext submissionContext,
                        org.apache.hadoop.conf.Configuration conf,
                        String user)
Method Detail

getAppAttemptId

public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getAppAttemptId()
Description copied from interface: RMAppAttempt
Get the application attempt id for this RMAppAttempt.

Specified by:
getAppAttemptId in interface RMAppAttempt
Returns:
the ApplicationAttemptId for this RM attempt.

getSubmissionContext

public org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getSubmissionContext()
Description copied from interface: RMAppAttempt
The application submission context for this RMAppAttempt.

Specified by:
getSubmissionContext in interface RMAppAttempt
Returns:
the application submission context for this Application.

getFinalApplicationStatus

public org.apache.hadoop.yarn.api.records.FinalApplicationStatus getFinalApplicationStatus()
Description copied from interface: RMAppAttempt
The final status set by the AM.

Specified by:
getFinalApplicationStatus in interface RMAppAttempt
Returns:
the final status that is set by the AM when unregistering itself. Can return a null if the AM has not unregistered itself.

getAppAttemptState

public RMAppAttemptState getAppAttemptState()
Description copied from interface: RMAppAttempt
The state of the RMAppAttempt.

Specified by:
getAppAttemptState in interface RMAppAttempt
Returns:
the state RMAppAttemptState of this RMAppAttempt

getHost

public String getHost()
Description copied from interface: RMAppAttempt
The host on which the RMAppAttempt is running/ran on.

Specified by:
getHost in interface RMAppAttempt
Returns:
the host on which the RMAppAttempt ran/is running on.

getRpcPort

public int getRpcPort()
Description copied from interface: RMAppAttempt
The rpc port of the RMAppAttempt.

Specified by:
getRpcPort in interface RMAppAttempt
Returns:
the rpc port of the RMAppAttempt to which the clients can connect to.

getTrackingUrl

public String getTrackingUrl()
Description copied from interface: RMAppAttempt
The url at which the status of the application attempt can be accessed.

Specified by:
getTrackingUrl in interface RMAppAttempt
Returns:
the url at which the status of the attempt can be accessed.

getOriginalTrackingUrl

public String getOriginalTrackingUrl()
Description copied from interface: RMAppAttempt
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.

Specified by:
getOriginalTrackingUrl in interface RMAppAttempt
Returns:
the url at which the status of the attempt can be accessed and is not fronted by a proxy.

getWebProxyBase

public String getWebProxyBase()
Description copied from interface: RMAppAttempt
The base to be prepended to web URLs that are not relative, and the user has been checked.

Specified by:
getWebProxyBase in interface RMAppAttempt
Returns:
the base URL to be prepended to web URLs that are not relative.

getClientTokenMasterKey

public SecretKey getClientTokenMasterKey()
Description copied from interface: RMAppAttempt
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.

Specified by:
getClientTokenMasterKey in interface RMAppAttempt
Returns:
The master key for client-to-AM tokens for this app attempt

getAMRMToken

public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getAMRMToken()
Description copied from interface: RMAppAttempt
The AMRMToken belonging to this app attempt

Specified by:
getAMRMToken in interface RMAppAttempt
Returns:
The AMRMToken belonging to this app attempt

createClientToken

public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.client.ClientToAMTokenIdentifier> createClientToken(String client)
Description copied from interface: RMAppAttempt
Create a token for authenticating a client connection to the app attempt

Specified by:
createClientToken in interface RMAppAttempt
Parameters:
client - the name of the client requesting the token
Returns:
the token or null if the attempt is not running

getDiagnostics

public String getDiagnostics()
Description copied from interface: RMAppAttempt
Diagnostics information for the application attempt.

Specified by:
getDiagnostics in interface RMAppAttempt
Returns:
diagnostics information for the application attempt.

setDiagnostics

public void setDiagnostics(String message)

getProgress

public float getProgress()
Description copied from interface: RMAppAttempt
Progress for the application attempt.

Specified by:
getProgress in interface RMAppAttempt
Returns:
the progress for this RMAppAttempt

getJustFinishedContainers

public List<org.apache.hadoop.yarn.api.records.ContainerStatus> getJustFinishedContainers()
Description copied from interface: RMAppAttempt
Return the list of last set of finished containers. This does not reset the finished containers.

Specified by:
getJustFinishedContainers in interface RMAppAttempt
Returns:
the list of just finished contianers, this does not reset the finished containers.

pullJustFinishedContainers

public List<org.apache.hadoop.yarn.api.records.ContainerStatus> pullJustFinishedContainers()
Description copied from interface: RMAppAttempt
Return a list of the last set of finished containers, resetting the finished containers to empty.

Specified by:
pullJustFinishedContainers in interface RMAppAttempt
Returns:
the list of just finished containers, re setting the finished containers.

getRanNodes

public Set<org.apache.hadoop.yarn.api.records.NodeId> getRanNodes()
Description copied from interface: RMAppAttempt
Nodes on which the containers for this RMAppAttempt ran.

Specified by:
getRanNodes in interface RMAppAttempt
Returns:
the set of nodes that ran any containers from this RMAppAttempt

getMasterContainer

public org.apache.hadoop.yarn.api.records.Container getMasterContainer()
Description copied from interface: RMAppAttempt
The container on which the Application Master is running.

Specified by:
getMasterContainer in interface RMAppAttempt
Returns:
the Container on which the application master is running.

handle

public void handle(RMAppAttemptEvent event)
Specified by:
handle in interface org.apache.hadoop.yarn.event.EventHandler<RMAppAttemptEvent>

getApplicationResourceUsageReport

public org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport getApplicationResourceUsageReport()
Description copied from interface: RMAppAttempt
Get application container and resource usage information.

Specified by:
getApplicationResourceUsageReport in interface RMAppAttempt
Returns:
an ApplicationResourceUsageReport object.

recover

public void recover(RMStateStore.RMState state)
             throws Exception
Specified by:
recover in interface Recoverable
Throws:
Exception

getStartTime

public long getStartTime()
Description copied from interface: RMAppAttempt
the start time of the application.

Specified by:
getStartTime in interface RMAppAttempt
Returns:
the start time of the application.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.