@Public
@Unstable
public class UnmanagedApplicationManager
extends java.lang.Object
AsyncCallback.| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
APP_NAME |
| Constructor | Description |
|---|---|
UnmanagedApplicationManager(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String queueName,
java.lang.String submitter,
java.lang.String appNameSuffix,
boolean keepContainersAcrossApplicationAttempts,
java.lang.String rmName,
org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext originalApplicationSubmissionContext) |
Constructor.
|
| Modifier and Type | Method | 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(java.lang.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.
|
org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext |
getApplicationSubmissionContext() |
|
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
UnmanagedApplicationManager with the resource
manager. |
void |
shutDownConnections() |
Shutdown this UAM client, without killing the UAM in the YarnRM side.
|
public static final java.lang.String APP_NAME
public UnmanagedApplicationManager(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
java.lang.String queueName,
java.lang.String submitter,
java.lang.String appNameSuffix,
boolean keepContainersAcrossApplicationAttempts,
java.lang.String rmName,
org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext originalApplicationSubmissionContext)
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 YarnRMoriginalApplicationSubmissionContext - ApplicationSubmissionContextkeepContainersAcrossApplicationAttempts - keep container flag for UAM
recovery. See #setKeepContainersAcrossApplicationAttempts(boolean)@VisibleForTesting 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,
java.io.IOException
org.apache.hadoop.yarn.exceptions.YarnException - if failsjava.io.IOException - if failspublic void reAttachUAM(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken)
throws java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
amrmToken - the UAM tokenjava.io.IOException - 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 java.io.IOException
java.io.IOExceptionpublic org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest request)
throws org.apache.hadoop.yarn.exceptions.YarnException,
java.io.IOException
UnmanagedApplicationManager with the resource
manager.request - RegisterApplicationMasterRequestorg.apache.hadoop.yarn.exceptions.YarnException - if register failsjava.io.IOException - 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,
java.io.IOException
request - the finishApplicationMaster requestorg.apache.hadoop.yarn.exceptions.YarnException - if finishAM call failsjava.io.IOException - if finishAM call failspublic org.apache.hadoop.yarn.api.protocolrecords.KillApplicationResponse forceKillApplication()
throws java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
java.io.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(java.lang.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 java.io.IOException
T - type of the proxyprotocol - protocol of the proxyconfig - configurationuser - ugi for the proxy connectiontoken - token for the connectionjava.io.IOException - 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 java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
appId - application idjava.io.IOException - 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 java.io.IOException,
org.apache.hadoop.yarn.exceptions.YarnException
java.io.IOException - if getApplicationReport failsorg.apache.hadoop.yarn.exceptions.YarnException - if getApplicationReport fails@VisibleForTesting public int getRequestQueueSize()
@VisibleForTesting protected void drainHeartbeatThread()
@VisibleForTesting protected boolean isHeartbeatThreadAlive()
@VisibleForTesting public org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext getApplicationSubmissionContext()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.