Class FederationProxyProviderUtil

java.lang.Object
org.apache.hadoop.yarn.server.federation.failover.FederationProxyProviderUtil

@Private @Unstable public final class FederationProxyProviderUtil extends Object
Utility class that creates proxy for specified protocols when federation is enabled. The class creates a federation aware failover provider, i.e. the failover provider uses the FederationStateStore to determine the current active ResourceManager
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> T
    createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, SubClusterId subClusterId, org.apache.hadoop.security.UserGroupInformation user)
    Create a proxy for the specified protocol in the context of Federation.
    static <T> T
    createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, SubClusterId subClusterId, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token)
    Create a proxy for the specified protocol in the context of Federation.
    static void
    updateConfForFederation(org.apache.hadoop.conf.Configuration conf, String subClusterId)
    Updating the conf with Federation as long as certain subclusterId.

    Methods inherited from class java.lang.Object

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

    • LOG

      public static final org.slf4j.Logger LOG
  • Method Details

    • createRMProxy

      @Public @Unstable public static <T> T createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, SubClusterId subClusterId, org.apache.hadoop.security.UserGroupInformation user) throws IOException
      Create a proxy for the specified protocol in the context of Federation. For non-HA, this is a direct connection to the ResourceManager address. When HA is enabled, the proxy handles the failover between the ResourceManagers as well.
      Type Parameters:
      T - Type information of the proxy
      Parameters:
      configuration - Configuration to generate ClientRMProxy
      protocol - Protocol for the proxy
      subClusterId - the unique identifier or the sub-cluster
      user - the user on whose behalf the proxy is being created
      Returns:
      Proxy to the RM
      Throws:
      IOException - on failure
    • createRMProxy

      @Public @Unstable public static <T> T createRMProxy(org.apache.hadoop.conf.Configuration configuration, Class<T> protocol, SubClusterId subClusterId, org.apache.hadoop.security.UserGroupInformation user, org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.TokenIdentifier> token) throws IOException
      Create a proxy for the specified protocol in the context of Federation. For non-HA, this is a direct connection to the ResourceManager address. When HA is enabled, the proxy handles the failover between the ResourceManagers as well.
      Type Parameters:
      T - Type information of the proxy
      Parameters:
      configuration - Configuration to generate ClientRMProxy
      protocol - Protocol for the proxy
      subClusterId - the unique identifier or the sub-cluster
      user - the user on whose behalf the proxy is being created
      token - the auth token to use for connection
      Returns:
      Proxy to the RM
      Throws:
      IOException - on failure
    • updateConfForFederation

      public static void updateConfForFederation(org.apache.hadoop.conf.Configuration conf, String subClusterId)
      Updating the conf with Federation as long as certain subclusterId.
      Parameters:
      conf - configuration
      subClusterId - subclusterId for the conf