Class HAUtilClient

java.lang.Object
org.apache.hadoop.hdfs.HAUtilClient

@Private public class HAUtilClient extends Object
  • Constructor Details

    • HAUtilClient

      public HAUtilClient()
  • Method Details

    • isLogicalUri

      public static boolean isLogicalUri(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri)
      Returns:
      true if the given nameNodeUri appears to be a logical URI.
    • isClientFailoverConfigured

      public static boolean isClientFailoverConfigured(org.apache.hadoop.conf.Configuration conf, URI nameNodeUri)
      Check whether the client has a failover proxy provider configured for the namenode/nameservice.
      Parameters:
      conf - Configuration
      nameNodeUri - The URI of namenode
      Returns:
      true if failover is configured.
    • buildTokenServiceForLogicalUri

      public static org.apache.hadoop.io.Text buildTokenServiceForLogicalUri(URI uri, String scheme)
      Get the service name used in the delegation token for the given logical HA service.
      Parameters:
      uri - the logical URI of the cluster
      scheme - the scheme of the corresponding FileSystem
      Returns:
      the service name
    • buildTokenServicePrefixForLogicalUri

      public static String buildTokenServicePrefixForLogicalUri(String scheme)
    • getServiceUriFromToken

      public static URI getServiceUriFromToken(String scheme, org.apache.hadoop.security.token.Token<?> token)
      Parse the file system URI out of the provided token.
    • isTokenForLogicalUri

      public static boolean isTokenForLogicalUri(org.apache.hadoop.security.token.Token<?> token)
      Returns:
      true if this token corresponds to a logical nameservice rather than a specific namenode.
    • cloneDelegationTokenForLogicalUri

      public static void cloneDelegationTokenForLogicalUri(org.apache.hadoop.security.UserGroupInformation ugi, URI haUri, Collection<InetSocketAddress> nnAddrs)
      Locate a delegation token associated with the given HA cluster URI, and if one is found, clone it to also represent the underlying namenode address.
      Parameters:
      ugi - the UGI to modify
      haUri - the logical URI for the cluster
      nnAddrs - collection of NNs in the cluster to which the token applies