Class FederationRegistryClient

java.lang.Object
org.apache.hadoop.yarn.server.federation.utils.FederationRegistryClient

public class FederationRegistryClient extends Object
Helper class that handles reads and writes to Yarn Registry to support UAM HA and second attempt.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FederationRegistryClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.registry.client.api.RegistryOperations registry, org.apache.hadoop.security.UserGroupInformation user)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    For testing, delete all application records in registry.
    Get the list of known applications in the registry.
    Map<String,org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>>
    loadStateFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId)
    Load the information of one application from registry.
    void
    removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId)
    Remove an application from registry.
    void
    removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId, boolean ignoreMemoryState)
    Remove an application from registry.
    boolean
    writeAMRMTokenForUAM(org.apache.hadoop.yarn.api.records.ApplicationId appId, String subClusterId, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token)
    Write/update the UAM token for an application and a sub-cluster.

    Methods inherited from class java.lang.Object

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

    • FederationRegistryClient

      public FederationRegistryClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.registry.client.api.RegistryOperations registry, org.apache.hadoop.security.UserGroupInformation user)
  • Method Details

    • getAllApplications

      public List<String> getAllApplications()
      Get the list of known applications in the registry.
      Returns:
      the list of known applications
    • cleanAllApplications

      @VisibleForTesting public void cleanAllApplications()
      For testing, delete all application records in registry.
    • writeAMRMTokenForUAM

      public boolean writeAMRMTokenForUAM(org.apache.hadoop.yarn.api.records.ApplicationId appId, String subClusterId, org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier> token)
      Write/update the UAM token for an application and a sub-cluster.
      Parameters:
      appId - ApplicationId.
      subClusterId - sub-cluster id of the token
      token - the UAM of the application
      Returns:
      whether the amrmToken is added or updated to a new value
    • loadStateFromRegistry

      public Map<String,org.apache.hadoop.security.token.Token<org.apache.hadoop.yarn.security.AMRMTokenIdentifier>> loadStateFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId)
      Load the information of one application from registry.
      Parameters:
      appId - application id
      Returns:
      the sub-cluster to UAM token mapping
    • removeAppFromRegistry

      public void removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId)
      Remove an application from registry.
      Parameters:
      appId - application id.
    • removeAppFromRegistry

      public void removeAppFromRegistry(org.apache.hadoop.yarn.api.records.ApplicationId appId, boolean ignoreMemoryState)
      Remove an application from registry.
      Parameters:
      appId - application id
      ignoreMemoryState - whether to ignore the memory data in terms of known application