@InterfaceAudience.Private public final class AMRMClientUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
APP_ALREADY_REGISTERED_MESSAGE |
Modifier and Type | Method and Description |
---|---|
static org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse |
allocateWithReRegister(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request,
org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy,
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Helper method for client calling ApplicationMasterProtocol.allocate that
handles re-register if RM fails over.
|
static <T> T |
createRMProxy(org.apache.hadoop.conf.Configuration configuration,
Class<T> protocol,
org.apache.hadoop.security.UserGroupInformation user,
org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token)
Create a proxy for the specified protocol.
|
static org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse |
finishAMWithReRegister(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request,
org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy,
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest,
org.apache.hadoop.yarn.api.records.ApplicationId appId)
Helper method for client calling
ApplicationMasterProtocol.finishApplicationMaster that handles re-register
if RM fails over.
|
static void |
handleNotRegisteredExceptionAndReRegister(org.apache.hadoop.yarn.api.records.ApplicationId appId,
org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy,
org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest)
Handle ApplicationNotRegistered exception and re-register.
|
public static final String APP_ALREADY_REGISTERED_MESSAGE
public static void handleNotRegisteredExceptionAndReRegister(org.apache.hadoop.yarn.api.records.ApplicationId appId, org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy, org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest) throws org.apache.hadoop.yarn.exceptions.YarnException
appId
- application IdrmProxy
- RM proxy instanceregisterRequest
- the AM re-register requestorg.apache.hadoop.yarn.exceptions.YarnException
- if re-register failspublic static org.apache.hadoop.yarn.api.protocolrecords.AllocateResponse allocateWithReRegister(org.apache.hadoop.yarn.api.protocolrecords.AllocateRequest request, org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy, org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
request
- allocate requestrmProxy
- RM proxyregisterRequest
- the register request for re-registerappId
- application idorg.apache.hadoop.yarn.exceptions.YarnException
- if RM call failsIOException
- if RM call failspublic static org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterResponse finishAMWithReRegister(org.apache.hadoop.yarn.api.protocolrecords.FinishApplicationMasterRequest request, org.apache.hadoop.yarn.api.ApplicationMasterProtocol rmProxy, org.apache.hadoop.yarn.api.protocolrecords.RegisterApplicationMasterRequest registerRequest, org.apache.hadoop.yarn.api.records.ApplicationId appId) throws org.apache.hadoop.yarn.exceptions.YarnException, IOException
request
- finishApplicationMaster requestrmProxy
- RM proxyregisterRequest
- the register request for re-registerappId
- application idorg.apache.hadoop.yarn.exceptions.YarnException
- if RM call failsIOException
- if RM call fails@InterfaceAudience.Public @InterfaceStability.Unstable public static <T> T createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token) throws IOException
T
- Type information of the proxyconfiguration
- Configuration to generate ClientRMProxy
protocol
- Protocol for the proxyuser
- the user on whose behalf the proxy is being createdtoken
- the auth token to use for connectionIOException
- on failureCopyright © 2018 Apache Software Foundation. All Rights Reserved.