@InterfaceAudience.Public @InterfaceStability.Unstable public class UnmanagedApplicationManager extends Object
AsyncCallback
.Modifier and Type | Class and Description |
---|---|
class |
UnmanagedApplicationManager.AMRequestHandlerThread
Extends Thread and provides an implementation that is used for processing
the AM heart beat request asynchronously and sending back the response
using the callback method registered with the system.
|
static class |
UnmanagedApplicationManager.AsyncAllocateRequestInfo
Data structure that encapsulates AllocateRequest and AsyncCallback
instance.
|
protected class |
UnmanagedApplicationManager.HeartBeatThreadUncaughtExceptionHandler
Uncaught exception handler for the background heartbeat thread.
|
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)
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 <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) |
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.
|
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.
|
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
UnmanagedApplicationManager with the resource
manager. |
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)
conf
- configurationappId
- application Id to use for this UAMqueueName
- the queue of the UAMsubmitter
- user name of the appappNameSuffix
- the app name suffix to usekeepContainersAcrossApplicationAttempts
- keep container flag for UAM
recovery. See #setKeepContainersAcrossApplicationAttempts(boolean)
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
IOException
public 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 org.apache.hadoop.yarn.api.records.ApplicationId getAppId()
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()
Copyright © 2008–2018 Apache Software Foundation. All rights reserved.