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/07/01 10:14:57 UTC
hbase git commit: HBASE-16114 Get regionLocation of required regions
only for MR jobs (Thiruvel Thirumoolan)
Repository: hbase
Updated Branches:
refs/heads/branch-1 b2f9f131b -> 5bc065552
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/5bc06555
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/5bc06555
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/5bc06555
Branch: refs/heads/branch-1
Commit: 5bc06555292d28e0e53861f4b51300c38db1184e
Parents: b2f9f13
Author: tedyu <yu...@gmail.com>
Authored: Fri Jul 1 03:14:51 2016 -0700
Committer: tedyu <yu...@gmail.com>
Committed: Fri Jul 1 03:14:51 2016 -0700
----------------------------------------------------------------------
.../hbase/mapreduce/TableInputFormatBase.java | 29 ++++++++++----------
1 file changed, 15 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hbase/blob/5bc06555/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 8d59016..148f367 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
@@ -276,20 +276,6 @@ extends InputFormat<ImmutableBytesWritable, Result> {
if ( !includeRegionInSplit(keys.getFirst()[i], keys.getSecond()[i])) {
continue;
}
- HRegionLocation location = regionLocator.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;
- try {
- regionLocation = reverseDNS(regionAddress);
- } catch (NamingException e) {
- LOG.warn("Cannot resolve the host name for " + regionAddress + " because of " + e);
- regionLocation = location.getHostname();
- }
byte[] startRow = scan.getStartRow();
byte[] stopRow = scan.getStopRow();
@@ -306,6 +292,21 @@ extends InputFormat<ImmutableBytesWritable, Result> {
keys.getSecond()[i].length > 0 ?
keys.getSecond()[i] : stopRow;
+ HRegionLocation location = regionLocator.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;
+ try {
+ regionLocation = reverseDNS(regionAddress);
+ } catch (NamingException e) {
+ LOG.warn("Cannot resolve the host name for " + regionAddress + " because of " + e);
+ regionLocation = location.getHostname();
+ }
+
byte[] regionName = location.getRegionInfo().getRegionName();
String encodedRegionName = location.getRegionInfo().getEncodedName();
long regionSize = sizeCalculator.getRegionSize(regionName);