ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject incubator-argus git commit: Argus-164 When HiveServer2 is restarted, Ranger Hive repository Lookup for database, tables and column fails
Date Fri, 07 Nov 2014 19:54:52 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master d9bb3f258 -> 9ad99f60d


Argus-164 When HiveServer2 is restarted, Ranger Hive repository Lookup
for database, tables and column fails

Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/9ad99f60
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/9ad99f60
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/9ad99f60

Branch: refs/heads/master
Commit: 9ad99f60dfb374bce832c537d432df50b540719f
Parents: d9bb3f2
Author: rmani <rmani@hortonworks.com>
Authored: Fri Nov 7 11:54:21 2014 -0800
Committer: rmani <rmani@hortonworks.com>
Committed: Fri Nov 7 11:54:21 2014 -0800

----------------------------------------------------------------------
 .../com/xasecure/biz/AssetConnectionMgr.java    | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/9ad99f60/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