Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 c1027f17f -> f11237c8e


PHOENIX-3600 Addendum to rework classes for HBase 0.98


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

Branch: refs/heads/4.x-HBase-0.98
Commit: f11237c8e191ce97c2f21ff8e8faeb2aa8e2b6d8
Parents: c1027f1
Author: Josh Mahonin <jmaho...@gmail.com>
Authored: Mon Feb 13 11:27:55 2017 -0500
Committer: Josh Mahonin <jmaho...@gmail.com>
Committed: Mon Feb 13 11:27:55 2017 -0500

----------------------------------------------------------------------
 .../apache/phoenix/mapreduce/PhoenixInputFormat.java   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f11237c8/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java
 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java
index 14f7b94..595d623 100644
--- 
a/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java
+++ 
b/phoenix-core/src/main/java/org/apache/phoenix/mapreduce/PhoenixInputFormat.java
@@ -94,17 +94,18 @@ public class PhoenixInputFormat<T extends DBWritable> 
extends InputFormat<NullWr
         Preconditions.checkNotNull(splits);
 
         // Get the RegionSizeCalculator
-        org.apache.hadoop.hbase.client.Connection connection = 
ConnectionFactory.createConnection(config);
-        RegionLocator regionLocator = 
connection.getRegionLocator(TableName.valueOf(qplan
-                .getTableRef().getTable().getPhysicalName().toString()));
-        RegionSizeCalculator sizeCalculator = new 
RegionSizeCalculator(regionLocator, connection
-                .getAdmin());
+        HConnection connection = HConnectionManager.createConnection(config);
+        String tableName = qplan
+                .getTableRef().getTable().getPhysicalName().toString();
+        HTable table = new HTable(config, tableName);
+        RegionSizeCalculator sizeCalculator = new RegionSizeCalculator(table);
 
 
         final List<InputSplit> psplits = 
Lists.newArrayListWithExpectedSize(splits.size());
         for (List<Scan> scans : qplan.getScans()) {
             // Get the region location
-            HRegionLocation location = regionLocator.getRegionLocation(
+            HRegionLocation location = connection.getRegionLocation(
+                    TableName.valueOf(tableName),
                     scans.get(0).getStartRow(),
                     false
             );

Reply via email to