diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java index b2f115cb403..9b5bbfb4538 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java @@ -27,8 +27,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import javax.naming.NamingException; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.conf.Configuration; @@ -285,12 +283,7 @@ extends InputFormat { } InetAddress regionAddress = isa.getAddress(); String regionLocation; - try { - regionLocation = reverseDNS(regionAddress); - } catch (NamingException e) { - LOG.warn("Cannot resolve the host name for " + regionAddress + " because of " + e); - regionLocation = location.getHostname(); - } + regionLocation = reverseDNS(regionAddress); byte[] startRow = scan.getStartRow(); byte[] stopRow = scan.getStopRow(); @@ -344,7 +337,7 @@ extends InputFormat { } } - String reverseDNS(InetAddress ipAddress) throws NamingException, UnknownHostException { + String reverseDNS(InetAddress ipAddress) throws UnknownHostException { String hostName = this.reverseDNSCacheMap.get(ipAddress); if (hostName == null) { String ipAddressString = null; diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java index c757a2d9b46..699e773ce9e 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java @@ -24,8 +24,6 @@ import java.net.Inet6Address; import java.net.InetAddress; import java.net.UnknownHostException; -import javax.naming.NamingException; - import org.apache.hadoop.hbase.testclassification.SmallTests; import org.junit.Test; import org.junit.experimental.categories.Category; @@ -34,7 +32,7 @@ import org.junit.experimental.categories.Category; public class TestTableInputFormatBase { @Test public void testTableInputFormatBaseReverseDNSForIPv6() - throws UnknownHostException, NamingException { + throws UnknownHostException { String address = "ipv6.google.com"; String localhost = null; InetAddress addr = null;