HBASE-15301 Remove the never-thrown NamingException from TableInputFormatBase#reverseDNS method signature (Yu Li)

This commit is contained in:
stack 2016-02-22 21:58:20 -08:00
parent 2d66cd86d0
commit 5e501123ca
2 changed files with 3 additions and 12 deletions

View File

@ -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<ImmutableBytesWritable, Result> {
}
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<ImmutableBytesWritable, Result> {
}
}
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;

View File

@ -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;