org.apache.hadoop.yarn.server.federation.utils

## 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 and Description
    `FederationRegistryClient(org.apache.hadoop.conf.Configuration conf, org.apache.hadoop.registry.client.api.RegistryOperations registry, org.apache.hadoop.security.UserGroupInformation user)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cleanAllApplications()` For testing, delete all application records in registry.
    `List<String>` | `getAllApplications()` 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.
    `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 Detail

    - #### FederationRegistryClient

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

  - ### Method Detail

    - #### getAllApplications

          public List<String> getAllApplications()

      Get the list of known applications in the registry.
      Returns:
        the list of known applications

    - #### cleanAllApplications

          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:
        `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

Copyright © 2008–2022 Apache Software Foundation. All rights reserved.