Return-Path: X-Original-To: apmail-argus-commits-archive@minotaur.apache.org Delivered-To: apmail-argus-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D3492175DF for ; Sat, 8 Nov 2014 05:32:28 +0000 (UTC) Received: (qmail 76777 invoked by uid 500); 8 Nov 2014 05:32:28 -0000 Delivered-To: apmail-argus-commits-archive@argus.apache.org Received: (qmail 76754 invoked by uid 500); 8 Nov 2014 05:32:28 -0000 Mailing-List: contact commits-help@argus.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@argus.incubator.apache.org Delivered-To: mailing list commits@argus.incubator.apache.org Received: (qmail 76745 invoked by uid 99); 8 Nov 2014 05:32:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2014 05:32:28 +0000 X-ASF-Spam-Status: No, hits=-2000.6 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 08 Nov 2014 05:32:27 +0000 Received: (qmail 76546 invoked by uid 99); 8 Nov 2014 05:32:07 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Nov 2014 05:32:07 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8430499EFA6; Sat, 8 Nov 2014 05:32:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sneethir@apache.org To: commits@argus.incubator.apache.org Message-Id: <956276a56ff240569c48413af7e25179@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: incubator-argus git commit: Argus-164 When HiveServer2 is restarted, Ranger Hive repository Lookup for database, tables and column fails Date: Sat, 8 Nov 2014 05:32:06 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org Repository: incubator-argus Updated Branches: refs/heads/ranger-0.4 8bbe099d2 -> 88e76c865 Argus-164 When HiveServer2 is restarted, Ranger Hive repository Lookup for database, tables and column fails Signed-off-by: sneethiraj Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/88e76c86 Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/88e76c86 Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/88e76c86 Branch: refs/heads/ranger-0.4 Commit: 88e76c865a0b05c78b44753232868fbd03130117 Parents: 8bbe099 Author: rmani Authored: Fri Nov 7 11:54:21 2014 -0800 Committer: sneethiraj Committed: Sat Nov 8 00:31:50 2014 -0500 ---------------------------------------------------------------------- .../com/xasecure/biz/AssetConnectionMgr.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/88e76c86/security-admin/src/main/java/com/xasecure/biz/AssetConnectionMgr.java ---------------------------------------------------------------------- diff --git a/security-admin/src/main/java/com/xasecure/biz/AssetConnectionMgr.java b/security-admin/src/main/java/com/xasecure/biz/AssetConnectionMgr.java index 5b5e07d..7df1321 100644 --- a/security-admin/src/main/java/com/xasecure/biz/AssetConnectionMgr.java +++ b/security-admin/src/main/java/com/xasecure/biz/AssetConnectionMgr.java @@ -136,7 +136,7 @@ public class AssetConnectionMgr { List testConnect = hadoopFS.listFiles("/", "*"); if(testConnect == null){ hadoopConnectionCache.remove(dataSourceName); - getHadoopConnection(dataSourceName); + hadoopFS = getHadoopConnection(dataSourceName); } } } @@ -179,6 +179,13 @@ public class AssetConnectionMgr { logger.error("Connection Config not defined for asset :" + asset.getName(), new Throwable()); } + } else { + try { + List testConnect = hiveClient.getDatabaseList("*"); + } catch(Exception e) { + hiveConnectionCache.remove(dataSourceName); + hiveClient = getHiveConnection(dataSourceName); + } } } } else { @@ -288,7 +295,7 @@ public class AssetConnectionMgr { try{ hBaseClient=new HBaseClient(dataSourceName); }catch(Exception ex){ - + logger.error("Error connecting HBase repository : ", ex); } } return hBaseClient; @@ -315,11 +322,10 @@ public class AssetConnectionMgr { try{ hBaseClient=new HBaseClient(dataSourceName,configMap); }catch(Exception ex){ - + logger.error("Error connecting HBase repository : ", ex); } } return hBaseClient; - } }; @@ -340,6 +346,12 @@ public class AssetConnectionMgr { if(client!=null){ hbaseConnectionCache.put(asset.getName(), client); } + } else { + List testConnect = client.getTableList(".\\*"); + if(testConnect == null){ + hbaseConnectionCache.remove(dataSourceName); + client = getHBaseConnection(dataSourceName); + } } repoConnectStatusMap.put(asset.getName(), true); }