Class AMRMProxyApplicationContextImpl
java.lang.Object
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AMRMProxyApplicationContextImpl
- All Implemented Interfaces:
AMRMProxyApplicationContext
Encapsulates the information about one application that is needed by the
request interceptors.
-
Constructor Summary
ConstructorsConstructorDescriptionAMRMProxyApplicationContextImpl(Context nmContext, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> localToken, org.apache.hadoop.security.Credentials credentials, org.apache.hadoop.registry.client.api.RegistryOperations registry) Create an instance of the AMRMProxyApplicationContext. -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>Gets the application's AMRMToken that is issued by the RM.org.apache.hadoop.yarn.api.records.ApplicationAttemptIdGets the application attempt identifier.org.apache.hadoop.conf.ConfigurationgetConf()Gets the configuration object instance.org.apache.hadoop.security.CredentialsGets the credentials of this application.org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>Gets the application's local AMRMToken issued by the proxy service.intGets the NMContext object.org.apache.hadoop.registry.client.api.RegistryOperationsGets the registry client.getUser()Gets the application submitter.booleansetAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken) Sets the application's AMRMToken.voidsetLocalAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> localToken) Sets the application's AMRMToken.
-
Constructor Details
-
AMRMProxyApplicationContextImpl
public AMRMProxyApplicationContextImpl(Context nmContext, org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, String user, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> localToken, org.apache.hadoop.security.Credentials credentials, org.apache.hadoop.registry.client.api.RegistryOperations registry) Create an instance of the AMRMProxyApplicationContext.- Parameters:
nmContext- NM contextconf- configurationapplicationAttemptId- attempt iduser- user name of the applicationamrmToken- amrmToken issued by RMlocalToken- amrmToken issued by AMRMProxycredentials- application credentialsregistry- Yarn Registry client
-
-
Method Details
-
getConf
public org.apache.hadoop.conf.Configuration getConf()Description copied from interface:AMRMProxyApplicationContextGets the configuration object instance.- Specified by:
getConfin interfaceAMRMProxyApplicationContext- Returns:
- the configuration object.
-
getApplicationAttemptId
public org.apache.hadoop.yarn.api.records.ApplicationAttemptId getApplicationAttemptId()Description copied from interface:AMRMProxyApplicationContextGets the application attempt identifier.- Specified by:
getApplicationAttemptIdin interfaceAMRMProxyApplicationContext- Returns:
- the application attempt identifier.
-
getUser
Description copied from interface:AMRMProxyApplicationContextGets the application submitter.- Specified by:
getUserin interfaceAMRMProxyApplicationContext- Returns:
- the application submitter
-
getAMRMToken
public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getAMRMToken()Description copied from interface:AMRMProxyApplicationContextGets the application's AMRMToken that is issued by the RM.- Specified by:
getAMRMTokenin interfaceAMRMProxyApplicationContext- Returns:
- the application's AMRMToken that is issued by the RM.
-
setAMRMToken
public boolean setAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> amrmToken) Sets the application's AMRMToken.- Parameters:
amrmToken- the new amrmToken from RM- Returns:
- whether the saved token is updated to a different value
-
getLocalAMRMToken
public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> getLocalAMRMToken()Description copied from interface:AMRMProxyApplicationContextGets the application's local AMRMToken issued by the proxy service.- Specified by:
getLocalAMRMTokenin interfaceAMRMProxyApplicationContext- Returns:
- the application's local AMRMToken issued by the proxy service.
-
setLocalAMRMToken
public void setLocalAMRMToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> localToken) Sets the application's AMRMToken.- Parameters:
localToken- amrmToken issued by AMRMProxy
-
getLocalAMRMTokenKeyId
@Private public int getLocalAMRMTokenKeyId() -
getNMContext
Description copied from interface:AMRMProxyApplicationContextGets the NMContext object.- Specified by:
getNMContextin interfaceAMRMProxyApplicationContext- Returns:
- the NMContext.
-
getCredentials
public org.apache.hadoop.security.Credentials getCredentials()Description copied from interface:AMRMProxyApplicationContextGets the credentials of this application.- Specified by:
getCredentialsin interfaceAMRMProxyApplicationContext- Returns:
- the credentials.
-
getRegistryClient
public org.apache.hadoop.registry.client.api.RegistryOperations getRegistryClient()Description copied from interface:AMRMProxyApplicationContextGets the registry client.- Specified by:
getRegistryClientin interfaceAMRMProxyApplicationContext- Returns:
- the registry.
-