@InterfaceAudience.Public @InterfaceStability.Unstable public class UnmanagedApplicationManager extends Object
AsyncCallback.| Constructor and Description | 
|---|
| UnmanagedApplicationManager(org.apache.hadoop.conf.Configuration conf,
                           org.apache.hadoop.yarn.api.records.ApplicationId appId,
                           String queueName,
                           String submitter,
                           String appNameSuffix,
                           boolean keepContainersAcrossApplicationAttempts,
                           String rmName)Constructor. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | allocateAsync(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request,
             org.apache.hadoop.yarn.util.AsyncCallback<org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse> callback)Sends the specified heart beat request to the resource manager and invokes
 the callback asynchronously with the response. | 
| protected AMHeartbeatRequestHandler | createAMHeartbeatRequestHandler(org.apache.hadoop.conf.Configuration config,
                               org.apache.hadoop.yarn.api.records.ApplicationId appId,
                               AMRMClientRelayer relayer) | 
| protected <T> T | createRMProxy(Class<T> protocol,
             org.apache.hadoop.conf.Configuration config,
             org.apache.hadoop.security.UserGroupInformation user,
             org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token)Returns RM proxy for the specified protocol type. | 
| protected void | createUAMProxy(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken) | 
| protected void | drainHeartbeatThread() | 
| org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse | finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)Unregisters from the resource manager and stops the request handler thread. | 
| org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse | forceKillApplication()Force kill the UAM. | 
| AMRMClientRelayer | getAMRMClientRelayer()Returns the rmProxy relayer of this UAM. | 
| org.apache.hadoop.yarn.api.records.ApplicationId | getAppId()Returns the application id of the UAM. | 
| int | getRequestQueueSize() | 
| protected org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> | getUAMToken()Gets the amrmToken of the unmanaged AM. | 
| protected org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> | initializeUnmanagedAM(org.apache.hadoop.yarn.api.records.ApplicationId appId)Launch and initialize an unmanaged AM. | 
| protected boolean | isHeartbeatThreadAlive() | 
| org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> | launchUAM()Launch a new UAM in the resource manager. | 
| void | reAttachUAM(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken)Re-attach to an existing UAM in the resource manager. | 
| org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse | registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request)Registers this  UnmanagedApplicationManagerwith the resource
 manager. | 
| void | shutDownConnections()Shutdown this UAM client, without killing the UAM in the YarnRM side. | 
public static final String APP_NAME
public UnmanagedApplicationManager(org.apache.hadoop.conf.Configuration conf,
                                   org.apache.hadoop.yarn.api.records.ApplicationId appId,
                                   String queueName,
                                   String submitter,
                                   String appNameSuffix,
                                   boolean keepContainersAcrossApplicationAttempts,
                                   String rmName)
conf - configurationappId - application Id to use for this UAMqueueName - the queue of the UAMsubmitter - user name of the appappNameSuffix - the app name suffix to usermName - name of the YarnRMkeepContainersAcrossApplicationAttempts - keep container flag for UAM
          recovery. See #setKeepContainersAcrossApplicationAttempts(boolean)protected AMHeartbeatRequestHandler createAMHeartbeatRequestHandler(org.apache.hadoop.conf.Configuration config, org.apache.hadoop.yarn.api.records.ApplicationId appId, AMRMClientRelayer relayer)
public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> launchUAM()
                                                                                                      throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                                                             IOException
org.apache.hadoop.yarn.exceptions.YarnException - if failsIOException - if failspublic void reAttachUAM(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken)
                 throws IOException,
                        org.apache.hadoop.yarn.exceptions.YarnException
amrmToken - the UAM tokenIOException - if re-attach failsorg.apache.hadoop.yarn.exceptions.YarnException - if re-attach failsprotected void createUAMProxy(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken)
                       throws IOException
IOExceptionpublic org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request)
                                                                                                       throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                                                              IOException
UnmanagedApplicationManager with the resource
 manager.request - RegisterApplicationMasterRequestorg.apache.hadoop.yarn.exceptions.YarnException - if register failsIOException - if register failspublic org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
                                                                                                   throws org.apache.hadoop.yarn.exceptions.YarnException,
                                                                                                          IOException
request - the finishApplicationMaster requestorg.apache.hadoop.yarn.exceptions.YarnException - if finishAM call failsIOException - if finishAM call failspublic org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse forceKillApplication()
                                                                                        throws IOException,
                                                                                               org.apache.hadoop.yarn.exceptions.YarnException
IOException - if fails to create rmProxyorg.apache.hadoop.yarn.exceptions.YarnException - if force kill failspublic void allocateAsync(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request,
                          org.apache.hadoop.yarn.util.AsyncCallback<org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse> callback)
                   throws org.apache.hadoop.yarn.exceptions.YarnException
request - the allocate requestcallback - the callback method for the requestorg.apache.hadoop.yarn.exceptions.YarnException - if registerAM is not called yetpublic void shutDownConnections()
public org.apache.hadoop.yarn.api.records.ApplicationId getAppId()
public AMRMClientRelayer getAMRMClientRelayer()
protected <T> T createRMProxy(Class<T> protocol, org.apache.hadoop.conf.Configuration config, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token) throws IOException
T - type of the proxyprotocol - protocal of the proxyconfig - configurationuser - ugi for the proxy connectiontoken - token for the connectionIOException - if fails to create the proxyprotected org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> initializeUnmanagedAM(org.apache.hadoop.yarn.api.records.ApplicationId appId)
                                                                                                                     throws IOException,
                                                                                                                            org.apache.hadoop.yarn.exceptions.YarnException
appId - application idIOException - if initialize failsorg.apache.hadoop.yarn.exceptions.YarnException - if initialize failsprotected org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getUAMToken()
                                                                                                           throws IOException,
                                                                                                                  org.apache.hadoop.yarn.exceptions.YarnException
IOException - if getApplicationReport failsorg.apache.hadoop.yarn.exceptions.YarnException - if getApplicationReport failspublic int getRequestQueueSize()
protected void drainHeartbeatThread()
protected boolean isHeartbeatThreadAlive()
Copyright © 2008–2023 Apache Software Foundation. All rights reserved.