Repository: phoenix
Updated Branches:
  refs/heads/5.x-HBase-2.0 ba1fd85dc -> d5b3faf2e


PHOENIX-4635 HBase Connection leak in 
org.apache.phoenix.hive.mapreduce.PhoenixInputFormat

Signed-off-by: Geoffrey Jacoby <gjac...@apache.org>


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

Branch: refs/heads/5.x-HBase-2.0
Commit: d5b3faf2ee03fd2964a60031bd965686242fe4fb
Parents: ba1fd85
Author: Yechao Chen <chenyec...@gmail.com>
Authored: Fri Mar 2 10:26:36 2018 +0800
Committer: Geoffrey Jacoby <gjac...@apache.org>
Committed: Fri Mar 2 10:50:11 2018 -0800

----------------------------------------------------------------------
 .../org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/d5b3faf2/phoenix-hive/src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java
----------------------------------------------------------------------
diff --git 
a/phoenix-hive/src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java
 
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java
index ff15972..b4f96ee 100644
--- 
a/phoenix-hive/src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java
+++ 
b/phoenix-hive/src/main/java/org/apache/phoenix/hive/mapreduce/PhoenixInputFormat.java
@@ -151,7 +151,7 @@ public class PhoenixInputFormat<T extends DBWritable> 
implements InputFormat<Wri
         setScanCacheSize(jobConf);
 
         // Adding Localization
-        org.apache.hadoop.hbase.client.Connection connection = 
ConnectionFactory.createConnection(PhoenixConnectionUtil.getConfiguration(jobConf));
+        try (org.apache.hadoop.hbase.client.Connection connection = 
ConnectionFactory.createConnection(PhoenixConnectionUtil.getConfiguration(jobConf)))
 {
         RegionLocator regionLocator = 
connection.getRegionLocator(TableName.valueOf(qplan
                 .getTableRef().getTable().getPhysicalName().toString()));
         RegionSizeCalculator sizeCalculator = new 
RegionSizeCalculator(regionLocator, connection
@@ -204,6 +204,7 @@ public class PhoenixInputFormat<T extends DBWritable> 
implements InputFormat<Wri
                 psplits.add(inputSplit);
             }
         }
+               }
 
         return psplits;
     }

Reply via email to