You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by co...@apache.org on 2017/03/13 09:48:24 UTC
[1/3] ranger git commit: RANGER-1402 - NPE if there is a problem with
the HiveClient driverClassName
Repository: ranger
Updated Branches:
refs/heads/master 4981181a9 -> c80d81189
RANGER-1402 - NPE if there is a problem with the HiveClient driverClassName
Signed-off-by: Colm O hEigeartaigh <co...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/58018b21
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/58018b21
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/58018b21
Branch: refs/heads/master
Commit: 58018b21b751293d803f7702920b13247b0c09ba
Parents: 4981181
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue Feb 21 12:05:39 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Mar 13 09:39:29 2017 +0000
----------------------------------------------------------------------
.../ranger/services/hive/client/HiveConnectionMgr.java | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/58018b21/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveConnectionMgr.java
----------------------------------------------------------------------
diff --git a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveConnectionMgr.java b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveConnectionMgr.java
index b36d5da..9376358 100644
--- a/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveConnectionMgr.java
+++ b/hive-agent/src/main/java/org/apache/ranger/services/hive/client/HiveConnectionMgr.java
@@ -64,10 +64,19 @@ public class HiveConnectionMgr {
LOG.error("Error connecting hive repository : "+
serviceName +" using config : "+ configs, e);
}
- HiveClient oldClient = hiveConnectionCache.putIfAbsent(serviceName, hiveClient);
+
+ HiveClient oldClient = null;
+ if (hiveClient != null) {
+ oldClient = hiveConnectionCache.putIfAbsent(serviceName, hiveClient);
+ } else {
+ oldClient = hiveConnectionCache.get(serviceName);
+ }
+
if (oldClient != null) {
// in the meantime someone else has put a valid client into the cache, let's use that instead.
- hiveClient.close();
+ if (hiveClient != null) {
+ hiveClient.close();
+ }
hiveClient = oldClient;
}
repoConnectStatusMap.put(serviceName, true);
[2/3] ranger git commit: RANGEr-1388 - Improve error messages in
AtlasKafkaResourceMapper
Posted by co...@apache.org.
RANGEr-1388 - Improve error messages in AtlasKafkaResourceMapper
Signed-off-by: Colm O hEigeartaigh <co...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/a4f1be82
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/a4f1be82
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/a4f1be82
Branch: refs/heads/master
Commit: a4f1be829c2eb1eb5bdaaa721ad30ffee7fe6530
Parents: 58018b2
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Feb 16 15:41:08 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Mar 13 09:40:33 2017 +0000
----------------------------------------------------------------------
.../ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/a4f1be82/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java
----------------------------------------------------------------------
diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java
index 9f1fc2d..09ae5d1 100644
--- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java
+++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasKafkaResourceMapper.java
@@ -44,6 +44,10 @@ public class AtlasKafkaResourceMapper extends AtlasResourceMapper {
public RangerServiceResource buildResource(final IReferenceableInstance entity) throws Exception {
String qualifiedName = getEntityAttribute(entity, ENTITY_ATTRIBUTE_QUALIFIED_NAME, String.class);
+ if(StringUtils.isEmpty(qualifiedName)) {
+ throwExceptionWithMessage("attribute '" + ENTITY_ATTRIBUTE_QUALIFIED_NAME + "' not found in entity");
+ }
+
String topic = getResourceNameFromQualifiedName(qualifiedName);
if(StringUtils.isEmpty(topic)) {
@@ -57,10 +61,9 @@ public class AtlasKafkaResourceMapper extends AtlasResourceMapper {
}
if(StringUtils.isEmpty(clusterName)) {
- throwExceptionWithMessage("attribute '" + ENTITY_ATTRIBUTE_QUALIFIED_NAME + "' not found in entity");
+ throwExceptionWithMessage("Cluster name not found in attribute '" + ENTITY_ATTRIBUTE_QUALIFIED_NAME + "'");
}
-
Map<String, RangerPolicyResource> elements = new HashMap<String, RangerPolicy.RangerPolicyResource>();
Boolean isExcludes = Boolean.FALSE;
Boolean isRecursive = Boolean.TRUE;
[3/3] ranger git commit: RANGER-1354 - Error on Atlas plugin install
Posted by co...@apache.org.
RANGER-1354 - Error on Atlas plugin install
Signed-off-by: Colm O hEigeartaigh <co...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/c80d8118
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/c80d8118
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/c80d8118
Branch: refs/heads/master
Commit: c80d81189e5e15d912176ac8430a3b0e9e7bb0a1
Parents: a4f1be8
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Thu Feb 9 11:27:21 2017 +0000
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Mon Mar 13 09:41:07 2017 +0000
----------------------------------------------------------------------
agents-common/scripts/enable-agent.sh | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ranger/blob/c80d8118/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index 1cc030a..9270c5f 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -224,9 +224,13 @@ fi
if [ ! -d "${HCOMPONENT_LIB_DIR}" ]
then
- echo "ERROR: Unable to find the lib directory of component [${HCOMPONENT_NAME}]; dir [${HCOMPONENT_LIB_DIR}] not found."
- echo "Exiting installation."
- exit 1
+ mkdir -p "${HCOMPONENT_LIB_DIR}"
+ if [ ! -d "${HCOMPONENT_LIB_DIR}" ]
+ then
+ echo "ERROR: Unable to find the lib directory of component [${HCOMPONENT_NAME}]; dir [${HCOMPONENT_LIB_DIR}] not found."
+ echo "Exiting installation."
+ exit 1
+ fi
fi
ambari_hive_install="N"