You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by rm...@apache.org on 2015/04/03 21:10:56 UTC

[1/2] incubator-ranger git commit: RANGER-225: Ranger-LookupResource and ValidateConfig implementation - Yarn TestConnection issue fix

Repository: incubator-ranger
Updated Branches:
  refs/heads/master 984fd5b86 -> 6ba785079


RANGER-225: Ranger-LookupResource and ValidateConfig implementation - Yarn TestConnection issue fix


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/520ae585
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/520ae585
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/520ae585

Branch: refs/heads/master
Commit: 520ae585b948e13c082f7911db7978d505bd9eac
Parents: 3fae96c
Author: rmani <rm...@hortonworks.com>
Authored: Fri Apr 3 12:10:39 2015 -0700
Committer: rmani <rm...@hortonworks.com>
Committed: Fri Apr 3 12:10:39 2015 -0700

----------------------------------------------------------------------
 .../ranger/services/yarn/client/YarnClient.java | 39 ++++++++++++++------
 1 file changed, 28 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/520ae585/plugin-yarn/src/main/java/org/apache/ranger/services/yarn/client/YarnClient.java
----------------------------------------------------------------------
diff --git a/plugin-yarn/src/main/java/org/apache/ranger/services/yarn/client/YarnClient.java b/plugin-yarn/src/main/java/org/apache/ranger/services/yarn/client/YarnClient.java
index 514c7ae..34c8b61 100644
--- a/plugin-yarn/src/main/java/org/apache/ranger/services/yarn/client/YarnClient.java
+++ b/plugin-yarn/src/main/java/org/apache/ranger/services/yarn/client/YarnClient.java
@@ -133,6 +133,7 @@ public class YarnClient {
 							lret = null;
 						}
 					} else {
+						lret = null;
 						String msgDesc = "Unable to get a valid response for "
 								+ "expected mime type : [" + EXPECTED_MIME_TYPE
 								+ "] URL : " + url + " - got null response.";
@@ -143,12 +144,15 @@ public class YarnClient {
 						throw hdpException;
 					}
 				} catch (HadoopException he) {
+					lret = null;
 					throw he;
 				} catch (Throwable t) {
+					lret = null;
 					String msgDesc = "Exception while getting Yarn Queue List."
 							+ " URL : " + url;
 					HadoopException hdpException = new HadoopException(msgDesc,
 							t);
+					
 					LOG.error(msgDesc, t);
 
 					hdpException.generateResponseDataMap(false,
@@ -164,7 +168,6 @@ public class YarnClient {
 					if (client != null) {
 						client.destroy(); 
 					}
-				
 				}
 				return lret ;
 			}
@@ -172,10 +175,20 @@ public class YarnClient {
 		
 		try {
 			ret = timedTask(yarnQueueListGetter, 5, TimeUnit.SECONDS);
-		} catch ( Exception e) {
-			LOG.error("Unable to get Yarn Queue list from [" + yarnQUrl + "]", e) ;
+		} catch ( Throwable t) {
+			LOG.error("Unable to get Yarn Queue list from [" + yarnQUrl + "]", t) ;
+			String msgDesc = "Unable to get a valid response for "
+					+ "expected mime type : [" + EXPECTED_MIME_TYPE
+					+ "] URL : " + yarnQUrl;
+			HadoopException hdpException = new HadoopException(msgDesc,
+					t);
+			LOG.error(msgDesc, t);
+
+			hdpException.generateResponseDataMap(false,
+					BaseClient.getMessage(t), msgDesc + errMsg, null,
+					null);
+			throw hdpException;
 		}
-		
 		return ret;
 	}
 	
@@ -195,7 +208,10 @@ public class YarnClient {
 				configs);
 		strList = getYarnResource(yarnClient, "",null);
 
-		if (strList != null) {
+		if (strList != null && strList.size() > 0 ) {
+			if (LOG.isDebugEnabled()) {
+				LOG.debug("TESTING list size" + strList.size() + " Yarn Queues");
+			}
 			connectivityStatus = true;
 		}
 
@@ -216,8 +232,7 @@ public class YarnClient {
 			Map<String, String> configs) {
 		YarnClient yarnClient = null;
 		if (LOG.isDebugEnabled()) {
-			LOG.debug("Getting YarnClient for datasource: " + serviceName
-					+ "configMap: " + configs);
+			LOG.debug("Getting YarnClient for datasource: " + serviceName);
 		}
 		String errMsg = errMessage;
 		if (configs == null || configs.isEmpty()) {
@@ -264,15 +279,17 @@ public class YarnClient {
 					}
 				}
 			}
-		} catch (HadoopException he) {
+		}
+		catch (HadoopException he) {
 			throw he;
-		} catch (Exception e) {
+		}
+		catch (Throwable t) {
 			String msgDesc = "getYarnResource: Unable to get Yarn resources.";
-			LOG.error(msgDesc, e);
+			LOG.error(msgDesc, t);
 			HadoopException hdpException = new HadoopException(msgDesc);
 
 			hdpException.generateResponseDataMap(false,
-					BaseClient.getMessage(e), msgDesc + errMsg, null, null);
+					BaseClient.getMessage(t), msgDesc + errMsg, null, null);
 			throw hdpException;
 		}
 		return resultList;


[2/2] incubator-ranger git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ranger

Posted by rm...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-ranger


Project: http://git-wip-us.apache.org/repos/asf/incubator-ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ranger/commit/6ba78507
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/6ba78507
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/6ba78507

Branch: refs/heads/master
Commit: 6ba785079cc4d09e25718b120fd8f0691e2ba10a
Parents: 520ae58 984fd5b
Author: rmani <rm...@hortonworks.com>
Authored: Fri Apr 3 12:10:48 2015 -0700
Committer: rmani <rm...@hortonworks.com>
Committed: Fri Apr 3 12:10:48 2015 -0700

----------------------------------------------------------------------
 .../ranger/plugin/policyengine/CacheMap.java    |  22 +++-
 .../service-defs/ranger-servicedef-hbase.json   |   2 +-
 .../service-defs/ranger-servicedef-hdfs.json    |   2 +-
 .../service-defs/ranger-servicedef-hive.json    |   2 +-
 .../service-defs/ranger-servicedef-kafka.json   |   4 +-
 .../service-defs/ranger-servicedef-knox.json    |   2 +-
 .../service-defs/ranger-servicedef-solr.json    |   2 +-
 .../service-defs/ranger-servicedef-storm.json   |   2 +-
 .../service-defs/ranger-servicedef-yarn.json    |   2 +-
 .../plugin/policyengine/TestCacheMap.java       | 123 +++++++++++++++++++
 10 files changed, 149 insertions(+), 14 deletions(-)
----------------------------------------------------------------------