Class AMRMProxyTokenSecretManager
java.lang.Object
org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>
org.apache.hadoop.yarn.server.nodemanager.amrmproxy.AMRMProxyTokenSecretManager
public class AMRMProxyTokenSecretManager
extends org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>
This secret manager instance is used by the AMRMProxyService to generate and
manage tokens.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.security.token.SecretManager
org.apache.hadoop.security.token.SecretManager.InvalidToken -
Constructor Summary
ConstructorsConstructorDescriptionAMRMProxyTokenSecretManager(NMStateStoreService nmStateStoreService) Create anAMRMProxyTokenSecretManager. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidapplicationMasterFinished(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>createAndGetAMRMToken(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) org.apache.hadoop.yarn.security.AMRMTokenIdentifierCreates an empty TokenId to be used for de-serializing anAMRMTokenIdentifierby the RPC layer.org.apache.hadoop.yarn.server.security.MasterKeyDataprotected byte[]createPassword(org.apache.hadoop.yarn.security.AMRMTokenIdentifier identifier) org.apache.hadoop.yarn.server.security.MasterKeyDataorg.apache.hadoop.yarn.server.security.MasterKeyDataorg.apache.hadoop.yarn.server.security.MasterKeyDatavoidinit(org.apache.hadoop.conf.Configuration conf) voidRecover secretManager from state store.byte[]retrievePassword(org.apache.hadoop.yarn.security.AMRMTokenIdentifier identifier) Retrieve the password for the givenAMRMTokenIdentifier.voidvoidsetNMStateStoreService(NMStateStoreService nmStateStoreService) voidstart()voidstop()Methods inherited from class org.apache.hadoop.security.token.SecretManager
checkAvailableForRead, createPassword, createSecretKey, generateSecret, retriableRetrievePassword, update, validateSecretKeyLength
-
Constructor Details
-
AMRMProxyTokenSecretManager
Create anAMRMProxyTokenSecretManager.- Parameters:
nmStateStoreService- NM state store
-
-
Method Details
-
init
public void init(org.apache.hadoop.conf.Configuration conf) -
start
public void start() -
stop
public void stop() -
setNMStateStoreService
-
applicationMasterFinished
public void applicationMasterFinished(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) -
rollMasterKey
@Private @VisibleForTesting public void rollMasterKey() -
activateNextMasterKey
@Private @VisibleForTesting public void activateNextMasterKey() -
createNewMasterKey
@Private @VisibleForTesting public org.apache.hadoop.yarn.server.security.MasterKeyData createNewMasterKey() -
createAndGetAMRMToken
public org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> createAndGetAMRMToken(org.apache.hadoop.yarn.api.records.ApplicationAttemptId appAttemptId) -
getMasterKey
@VisibleForTesting public org.apache.hadoop.yarn.server.security.MasterKeyData getMasterKey() -
retrievePassword
public byte[] retrievePassword(org.apache.hadoop.yarn.security.AMRMTokenIdentifier identifier) throws org.apache.hadoop.security.token.SecretManager.InvalidToken Retrieve the password for the givenAMRMTokenIdentifier. Used by RPC layer to validate a remoteAMRMTokenIdentifier.- Specified by:
retrievePasswordin classorg.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>- Throws:
org.apache.hadoop.security.token.SecretManager.InvalidToken
-
createIdentifier
public org.apache.hadoop.yarn.security.AMRMTokenIdentifier createIdentifier()Creates an empty TokenId to be used for de-serializing anAMRMTokenIdentifierby the RPC layer.- Specified by:
createIdentifierin classorg.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>
-
getCurrentMasterKeyData
@Private @VisibleForTesting public org.apache.hadoop.yarn.server.security.MasterKeyData getCurrentMasterKeyData() -
getNextMasterKeyData
@Private @VisibleForTesting public org.apache.hadoop.yarn.server.security.MasterKeyData getNextMasterKeyData() -
createPassword
@Private protected byte[] createPassword(org.apache.hadoop.yarn.security.AMRMTokenIdentifier identifier) - Specified by:
createPasswordin classorg.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>
-
recover
Recover secretManager from state store. Called after serviceInit before serviceStart.- Parameters:
state- the state to recover from
-