Package org.apache.hadoop.hbase.util
Class DNS
java.lang.Object
org.apache.hadoop.hbase.util.DNS
Wrapper around Hadoop's DNS class to hide reflection.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDefaultHost
(String strInterface, String nameserver) Wrapper around DNS.getDefaultHost(String, String), calling DNS.getDefaultHost(String, String, boolean) when available.static String
getHostname
(org.apache.hadoop.conf.Configuration conf, DNS.ServerType serverType) Get the configured hostname for a given ServerType.
-
Field Details
-
UNSAFE_RS_HOSTNAME_KEY
- See Also:
-
MASTER_HOSTNAME_KEY
- See Also:
-
HAS_NEW_DNS_GET_DEFAULT_HOST_API
-
GET_DEFAULT_HOST_METHOD
-
RS_HOSTNAME_KEY
Deprecated.since 2.4.0 and will be removed in 4.0.0. UseUNSAFE_RS_HOSTNAME_KEY
instead.Hostname configuration key- See Also:
-
-
Constructor Details
-
DNS
private DNS()
-
-
Method Details
-
getDefaultHost
public static String getDefaultHost(String strInterface, String nameserver) throws UnknownHostException Wrapper around DNS.getDefaultHost(String, String), calling DNS.getDefaultHost(String, String, boolean) when available.- Parameters:
strInterface
- The network interface to query.nameserver
- The DNS host name.- Returns:
- The default host names associated with IPs bound to the network interface.
- Throws:
UnknownHostException
-
getHostname
public static String getHostname(@NonNull org.apache.hadoop.conf.Configuration conf, @NonNull DNS.ServerType serverType) throws UnknownHostException Get the configured hostname for a given ServerType. Gets the default hostname if not specified in the configuration.- Parameters:
conf
- Configuration to look up.serverType
- ServerType to look up in the configuration for overrides.- Throws:
UnknownHostException
-