Interface DomainNameResolver

All Known Implementing Classes:
DNSDomainNameResolver

public interface DomainNameResolver
This interface provides methods for the failover proxy to get IP addresses of the associated servers (NameNodes, RBF routers etc). Implementations will use their own service discovery mechanism, DNS, Zookeeper etc
  • Method Summary

    Modifier and Type
    Method
    Description
    Takes one domain name and returns its IP addresses based on the actual service discovery methods.
    getAllResolvedHostnameByDomainName(String domainName, boolean useFQDN)
    This function combines getAllByDomainName and getHostnameByIP, for a single domain name, it will first do a forward lookup to get all of IP addresses, then for each IP address, it will do a reverse lookup to get the fqdn.
    Reverse lookup an IP address and get the fully qualified domain name(fqdn).
  • Method Details

    • getAllByDomainName

      InetAddress[] getAllByDomainName(String domainName) throws UnknownHostException
      Takes one domain name and returns its IP addresses based on the actual service discovery methods.
      Parameters:
      domainName - input domainName.
      Returns:
      all IP addresses
      Throws:
      UnknownHostException - indicate that the IP address of a host could not be determined.
    • getHostnameByIP

      String getHostnameByIP(InetAddress address)
      Reverse lookup an IP address and get the fully qualified domain name(fqdn).
      Parameters:
      address - input address.
      Returns:
      fully qualified domain name
    • getAllResolvedHostnameByDomainName

      String[] getAllResolvedHostnameByDomainName(String domainName, boolean useFQDN) throws UnknownHostException
      This function combines getAllByDomainName and getHostnameByIP, for a single domain name, it will first do a forward lookup to get all of IP addresses, then for each IP address, it will do a reverse lookup to get the fqdn. This function is necessary in secure environment since Kerberos uses fqdn in the service principal instead of IP.
      Parameters:
      domainName - input domainName.
      useFQDN - input useFQDN.
      Returns:
      all fully qualified domain names belonging to the IPs resolved from the input domainName
      Throws:
      UnknownHostException - indicate that the IP address of a host could not be determined.