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


Nested Class Summary
static class RMAppAttemptImpl.ScheduleTransition
           
 
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, boolean maybeLastAttempt, org.apache.hadoop.yarn.api.records.ResourceRequest amReq)
           
 
Method Summary
 org.apache.hadoop.yarn.api.records.ApplicationAttemptReport createApplicationAttemptReport()
          Create the Application attempt report from the RMAppAttempt
 org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState createApplicationAttemptState()
          Create the external user-facing state of the attempt of ApplicationMaster from the current state of the RMAppAttempt.
 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
 int getAMContainerExitStatus()
           
 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.
 ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getFinishedContainersSentToAMReference()
          The map of conatiners per Node that are already sent to the AM.
 long getFinishTime()
          the finish time of the application attempt.
 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.
 ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getJustFinishedContainersReference()
          Returns a reference to the map of last set of finished containers to the corresponding node.
 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.
 RMAppAttemptMetrics getRMAppAttemptMetrics()
          Get metrics from the RMAppAttempt
 int getRpcPort()
          The rpc port of the RMAppAttempt.
 long getStartTime()
          the start time of the application.
 RMAppAttemptState getState()
          The current state of the RMAppAttempt.
 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)
           
 boolean mayBeLastAttempt()
           
 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 setAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> lastToken)
           
 void setMasterContainer(org.apache.hadoop.yarn.api.records.Container container)
           
 boolean shouldCountTowardsMaxAttemptRetry()
          Return the flag which indicates whether the attempt failure should be counted to attempt retry count.
 void transferStateFromPreviousAttempt(RMAppAttempt attempt)
           
 
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,
                        boolean maybeLastAttempt,
                        org.apache.hadoop.yarn.api.records.ResourceRequest amReq)
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

setAMRMToken

@InterfaceAudience.Private
public void setAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> lastToken)

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.

getAMContainerExitStatus

public int getAMContainerExitStatus()

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 containers

getJustFinishedContainersReference

public ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getJustFinishedContainersReference()
Description copied from interface: RMAppAttempt
Returns a reference to the map of last set of finished containers to the corresponding node. This does not reset the finished containers.

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

getFinishedContainersSentToAMReference

public ConcurrentMap<org.apache.hadoop.yarn.api.records.NodeId,List<org.apache.hadoop.yarn.api.records.ContainerStatus>> getFinishedContainersSentToAMReference()
Description copied from interface: RMAppAttempt
The map of conatiners per Node that are already sent to the AM.

Specified by:
getFinishedContainersSentToAMReference in interface RMAppAttempt
Returns:
map of per node list of finished container status sent to AM

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.

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.

setMasterContainer

@InterfaceAudience.Private
public void setMasterContainer(org.apache.hadoop.yarn.api.records.Container container)

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)
Specified by:
recover in interface Recoverable

transferStateFromPreviousAttempt

public void transferStateFromPreviousAttempt(RMAppAttempt attempt)

shouldCountTowardsMaxAttemptRetry

public boolean shouldCountTowardsMaxAttemptRetry()
Description copied from interface: RMAppAttempt
Return the flag which indicates whether the attempt failure should be counted to attempt retry count.

Specified by:
shouldCountTowardsMaxAttemptRetry in interface RMAppAttempt

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.

getState

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

Specified by:
getState in interface RMAppAttempt
Returns:
the current state RMAppAttemptState for this application attempt.

createApplicationAttemptState

public org.apache.hadoop.yarn.api.records.YarnApplicationAttemptState createApplicationAttemptState()
Description copied from interface: RMAppAttempt
Create the external user-facing state of the attempt of ApplicationMaster from the current state of the RMAppAttempt.

Specified by:
createApplicationAttemptState in interface RMAppAttempt
Returns:
the external user-facing state of the attempt ApplicationMaster.

createApplicationAttemptReport

public org.apache.hadoop.yarn.api.records.ApplicationAttemptReport createApplicationAttemptReport()
Description copied from interface: RMAppAttempt
Create the Application attempt report from the RMAppAttempt

Specified by:
createApplicationAttemptReport in interface RMAppAttempt
Returns:
ApplicationAttemptReport

mayBeLastAttempt

public boolean mayBeLastAttempt()

getRMAppAttemptMetrics

public RMAppAttemptMetrics getRMAppAttemptMetrics()
Description copied from interface: RMAppAttempt
Get metrics from the RMAppAttempt

Specified by:
getRMAppAttemptMetrics in interface RMAppAttempt
Returns:
metrics

getFinishTime

public long getFinishTime()
Description copied from interface: RMAppAttempt
the finish time of the application attempt.

Specified by:
getFinishTime in interface RMAppAttempt
Returns:
the finish time of the application attempt.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.