hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject hbase git commit: HBASE-15301 Remove the never-thrown NamingException from TableInputFormatBase#reverseDNS method signature (Yu Li)
Date Tue, 23 Feb 2016 05:58:28 GMT
Repository: hbase
Updated Branches:
  refs/heads/master 2d66cd86d -> 5e501123c


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


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/5e501123
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5e501123
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5e501123

Branch: refs/heads/master
Commit: 5e501123ca7854b18c63674029cdf3e7aeac5cf9
Parents: 2d66cd8
Author: stack <stack@apache.org>
Authored: Mon Feb 22 21:58:20 2016 -0800
Committer: stack <stack@apache.org>
Committed: Mon Feb 22 21:58:20 2016 -0800

----------------------------------------------------------------------
 .../hadoop/hbase/mapreduce/TableInputFormatBase.java     | 11 ++---------
 .../hadoop/hbase/mapreduce/TestTableInputFormatBase.java |  4 +---
 2 files changed, 3 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/5e501123/hbase-server/src/main/java/org/apache/hadoop/hbase/mapreduce/TableInputFormatBase.java
----------------------------------------------------------------------
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 b2f115c..9b5bbfb 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<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;

http://git-wip-us.apache.org/repos/asf/hbase/blob/5e501123/hbase-server/src/test/java/org/apache/hadoop/hbase/mapreduce/TestTableInputFormatBase.java
----------------------------------------------------------------------
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 c757a2d..699e773 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;


Mime
View raw message