@InterfaceAudience.Public
@InterfaceStability.Unstable
public class UnmanagedAMPoolManager
extends org.apache.hadoop.service.AbstractService
UnmanagedApplicationManager
.Modifier and Type | Field and Description |
---|---|
static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
UnmanagedAMPoolManager(ExecutorService threadpool) |
Modifier and Type | Method and Description |
---|---|
void |
allocateAsync(String uamId,
org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request,
org.apache.hadoop.yarn.util.AsyncCallback<org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse> callback)
AllocateAsync to an UAM.
|
String |
createAndRegisterNewUAM(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest,
org.apache.hadoop.conf.Configuration conf,
String queueName,
String submitter,
String appNameSuffix,
boolean keepContainersAcrossApplicationAttempts)
Create a new UAM and register the application, without specifying uamId and
appId.
|
protected UnmanagedApplicationManager |
createUAM(org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
String queueName,
String submitter,
String appNameSuffix,
boolean keepContainersAcrossApplicationAttempts)
Creates the UAM instance.
|
org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse |
finishApplicationMaster(String uamId,
org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request)
Finish an UAM/application.
|
Set<String> |
getAllUAMIds()
Get the id of all running UAMs.
|
boolean |
hasUAMId(String uamId)
Return whether an UAM exists.
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> |
launchUAM(String uamId,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
String queueName,
String submitter,
String appNameSuffix,
boolean keepContainersAcrossApplicationAttempts)
Launch a new UAM, using the provided uamId and appId.
|
void |
reAttachUAM(String uamId,
org.apache.hadoop.conf.Configuration conf,
org.apache.hadoop.yarn.api.records.ApplicationId appId,
String queueName,
String submitter,
String appNameSuffix,
org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> uamToken)
Re-attach to an existing UAM, using the provided uamIdentifier.
|
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse |
registerApplicationMaster(String uamId,
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest)
Register application master for the UAM.
|
protected void |
serviceStart() |
protected void |
serviceStop()
Normally we should finish all applications before stop.
|
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, serviceInit, setConfig, start, stop, toString, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
public UnmanagedAMPoolManager(ExecutorService threadpool)
protected void serviceStart() throws Exception
serviceStart
in class org.apache.hadoop.service.AbstractService
Exception
protected void serviceStop() throws Exception
serviceStop
in class org.apache.hadoop.service.AbstractService
Exception
public String createAndRegisterNewUAM(org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest, org.apache.hadoop.conf.Configuration conf, String queueName, String submitter, String appNameSuffix, boolean keepContainersAcrossApplicationAttempts) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
registerRequest
- RegisterApplicationMasterRequestconf
- configuration for this UAMqueueName
- queue of the applicationsubmitter
- submitter name of the UAMappNameSuffix
- application name suffix for the UAMkeepContainersAcrossApplicationAttempts
- keep container flag for UAM
recovery.org.apache.hadoop.yarn.exceptions.YarnException
- if registerApplicationMaster failsIOException
- if registerApplicationMaster fails#setKeepContainersAcrossApplicationAttempts(boolean)
public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> launchUAM(String uamId, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationId appId, String queueName, String submitter, String appNameSuffix, boolean keepContainersAcrossApplicationAttempts) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
uamId
- uam Idconf
- configuration for this UAMappId
- application id for the UAMqueueName
- queue of the applicationsubmitter
- submitter name of the UAMappNameSuffix
- application name suffix for the UAMkeepContainersAcrossApplicationAttempts
- keep container flag for UAM
recovery.org.apache.hadoop.yarn.exceptions.YarnException
- if failsIOException
- if fails#setKeepContainersAcrossApplicationAttempts(boolean)
public void reAttachUAM(String uamId, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationId appId, String queueName, String submitter, String appNameSuffix, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> uamToken) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
uamId
- uam Idconf
- configuration for this UAMappId
- application id for the UAMqueueName
- queue of the applicationsubmitter
- submitter name of the UAMappNameSuffix
- application name suffix for the UAMuamToken
- UAM tokenorg.apache.hadoop.yarn.exceptions.YarnException
- if failsIOException
- if failsprotected UnmanagedApplicationManager createUAM(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 idqueueName
- queue of the applicationsubmitter
- submitter name of the applicationappNameSuffix
- application name suffixkeepContainersAcrossApplicationAttempts
- keep container flag for UAMpublic org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterResponse registerApplicationMaster(String uamId, org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
uamId
- uam IdregisterRequest
- RegisterApplicationMasterRequestorg.apache.hadoop.yarn.exceptions.YarnException
- if register failsIOException
- if register failspublic void allocateAsync(String uamId, 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, IOException
uamId
- uam Idrequest
- AllocateRequestcallback
- callback for responseorg.apache.hadoop.yarn.exceptions.YarnException
- if allocate failsIOException
- if allocate failspublic org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishApplicationMaster(String uamId, org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
uamId
- uam Idrequest
- FinishApplicationMasterRequestorg.apache.hadoop.yarn.exceptions.YarnException
- if finishApplicationMaster call failsIOException
- if finishApplicationMaster call failspublic boolean hasUAMId(String uamId)
uamId
- uam IdCopyright © 2018 Apache Software Foundation. All Rights Reserved.