You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by te...@apache.org on 2016/06/29 23:34:51 UTC

hbase git commit: HBASE-16114 Get regionLocation of required regions only for MR jobs (Thiruvel Thirumoolan)

Repository: hbase
Updated Branches:
  refs/heads/master a3546a375 -> 42106b89b


HBASE-16114 Get regionLocation of required regions only for MR jobs (Thiruvel Thirumoolan)


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

Branch: refs/heads/master
Commit: 42106b89b10419aaa557369f4eb9c71962cd2656
Parents: a3546a3
Author: tedyu <yu...@gmail.com>
Authored: Wed Jun 29 16:34:44 2016 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Wed Jun 29 16:34:44 2016 -0700

----------------------------------------------------------------------
 .../hbase/mapreduce/TableInputFormatBase.java   | 23 ++++++++++----------
 1 file changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/42106b89/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 53148dc..9ebb3c1 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
@@ -275,16 +275,7 @@ extends InputFormat<ImmutableBytesWritable, Result> {
         if (!includeRegionInSplit(keys.getFirst()[i], keys.getSecond()[i])) {
           continue;
         }
-        HRegionLocation location = getRegionLocator().getRegionLocation(keys.getFirst()[i], false);
-        // The below InetSocketAddress creation does a name resolution.
-        InetSocketAddress isa = new InetSocketAddress(location.getHostname(), location.getPort());
-        if (isa.isUnresolved()) {
-          LOG.warn("Failed resolve " + isa);
-        }
-        InetAddress regionAddress = isa.getAddress();
-        String regionLocation;
-        regionLocation = reverseDNS(regionAddress);
-  
+
         byte[] startRow = scan.getStartRow();
         byte[] stopRow = scan.getStopRow();
         // determine if the given start an stop key fall into the region
@@ -299,7 +290,17 @@ extends InputFormat<ImmutableBytesWritable, Result> {
             Bytes.compareTo(keys.getSecond()[i], stopRow) <= 0) &&
             keys.getSecond()[i].length > 0 ?
               keys.getSecond()[i] : stopRow;
-  
+
+          HRegionLocation location = getRegionLocator().getRegionLocation(keys.getFirst()[i], false);
+          // The below InetSocketAddress creation does a name resolution.
+          InetSocketAddress isa = new InetSocketAddress(location.getHostname(), location.getPort());
+          if (isa.isUnresolved()) {
+            LOG.warn("Failed resolve " + isa);
+          }
+          InetAddress regionAddress = isa.getAddress();
+          String regionLocation;
+          regionLocation = reverseDNS(regionAddress);
+
           byte[] regionName = location.getRegionInfo().getRegionName();
           String encodedRegionName = location.getRegionInfo().getEncodedName();
           long regionSize = sizeCalculator.getRegionSize(regionName);