ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sneet...@apache.org
Subject incubator-argus git commit: Argus-164 When HiveServer2 is restarted, Ranger Hive repository Lookup for database, tables and column fails
Date Sat, 08 Nov 2014 05:32:06 GMT
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 <sneethir@apache.org>


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 <rmani@hortonworks.com>
Authored: Fri Nov 7 11:54:21 2014 -0800
Committer: sneethiraj <sneethir@apache.org>
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<String> 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<String> 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<String> testConnect = client.getTableList(".\\*");
+					if(testConnect == null){
+						hbaseConnectionCache.remove(dataSourceName);
+						client = getHBaseConnection(dataSourceName);
+					}
 				}
 				repoConnectStatusMap.put(asset.getName(), true);
 			}


Mime
View raw message