Class BaseNMTokenSecretManager

java.lang.Object
org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.NMTokenIdentifier>
org.apache.hadoop.yarn.server.security.BaseNMTokenSecretManager

public class BaseNMTokenSecretManager extends org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.NMTokenIdentifier>
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.hadoop.security.token.SecretManager

    org.apache.hadoop.security.token.SecretManager.InvalidToken
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected MasterKeyData
     
    protected final Lock
     
    protected final ReadWriteLock
     
    protected int
     
    protected final Lock
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.hadoop.yarn.security.NMTokenIdentifier
    It is required for RPC
    protected MasterKeyData
     
    org.apache.hadoop.yarn.api.records.Token
    createNMToken(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String applicationSubmitter)
    Helper function for creating NMTokens.
    protected byte[]
    createPassword(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier)
     
     
    static org.apache.hadoop.yarn.api.records.Token
    newInstance(byte[] password, org.apache.hadoop.yarn.security.NMTokenIdentifier identifier)
     
    byte[]
    retrievePassword(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier)
     
    protected byte[]
    retrivePasswordInternal(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier, MasterKeyData masterKey)
     

    Methods inherited from class org.apache.hadoop.security.token.SecretManager

    checkAvailableForRead, createPassword, createSecretKey, generateSecret, retriableRetrievePassword, update, validateSecretKeyLength

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • serialNo

      protected int serialNo
    • readWriteLock

      protected final ReadWriteLock readWriteLock
    • readLock

      protected final Lock readLock
    • writeLock

      protected final Lock writeLock
    • currentMasterKey

      protected MasterKeyData currentMasterKey
  • Constructor Details

    • BaseNMTokenSecretManager

      public BaseNMTokenSecretManager()
  • Method Details

    • createNewMasterKey

      protected MasterKeyData createNewMasterKey()
    • getCurrentKey

      @Private public MasterKey getCurrentKey()
    • createPassword

      protected byte[] createPassword(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier)
      Specified by:
      createPassword in class org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.NMTokenIdentifier>
    • retrievePassword

      public byte[] retrievePassword(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier) throws org.apache.hadoop.security.token.SecretManager.InvalidToken
      Specified by:
      retrievePassword in class org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.NMTokenIdentifier>
      Throws:
      org.apache.hadoop.security.token.SecretManager.InvalidToken
    • retrivePasswordInternal

      protected byte[] retrivePasswordInternal(org.apache.hadoop.yarn.security.NMTokenIdentifier identifier, MasterKeyData masterKey)
    • createIdentifier

      public org.apache.hadoop.yarn.security.NMTokenIdentifier createIdentifier()
      It is required for RPC
      Specified by:
      createIdentifier in class org.apache.hadoop.security.token.SecretManager<org.apache.hadoop.yarn.security.NMTokenIdentifier>
    • createNMToken

      public org.apache.hadoop.yarn.api.records.Token createNMToken(org.apache.hadoop.yarn.api.records.ApplicationAttemptId applicationAttemptId, org.apache.hadoop.yarn.api.records.NodeId nodeId, String applicationSubmitter)
      Helper function for creating NMTokens.
      Parameters:
      applicationAttemptId - application AttemptId.
      nodeId - node Id.
      applicationSubmitter - application Submitter.
      Returns:
      NMToken.
    • newInstance

      public static org.apache.hadoop.yarn.api.records.Token newInstance(byte[] password, org.apache.hadoop.yarn.security.NMTokenIdentifier identifier)