You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/09/29 02:47:32 UTC

[kylin] branch master updated: KYLIN-3603 Close the HBase connection after used in UpdateHTableHostCLI

This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 910b79e  KYLIN-3603 Close the HBase connection after used in UpdateHTableHostCLI
910b79e is described below

commit 910b79e81f415eb9db4fcb414792132ade71df74
Author: Lijun Cao <64...@qq.com>
AuthorDate: Sat Sep 29 09:11:45 2018 +0800

    KYLIN-3603 Close the HBase connection after used in UpdateHTableHostCLI
---
 .../org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
index bf5c4e8..ae8582c 100644
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
+++ b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/UpdateHTableHostCLI.java
@@ -59,9 +59,10 @@ public class UpdateHTableHostCLI {
     public UpdateHTableHostCLI(List<String> htables, String oldHostValue) throws IOException {
         this.htables = htables;
         this.oldHostValue = oldHostValue;
-        Connection conn = ConnectionFactory.createConnection(HBaseConfiguration.create());
-        hbaseAdmin = conn.getAdmin();
-        this.kylinConfig = KylinConfig.getInstanceFromEnv();
+        try (Connection conn = ConnectionFactory.createConnection(HBaseConfiguration.create());) {
+            hbaseAdmin = conn.getAdmin();
+            this.kylinConfig = KylinConfig.getInstanceFromEnv();
+        }
     }
 
     public static void main(String[] args) throws Exception {