ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-ranger git commit: RANGER-1043: Update tagsync for changes in ATLAS-542 - table.name -> table.qualifiedName
Date Mon, 20 Jun 2016 06:51:43 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/master c3d48e666 -> 8d353cb44


RANGER-1043: Update tagsync for changes in ATLAS-542 - table.name -> table.qualifiedName


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

Branch: refs/heads/master
Commit: 8d353cb441fae0e47ba434fdf2f9b3cd9834def5
Parents: c3d48e6
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Sun Jun 19 02:31:36 2016 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Sun Jun 19 02:31:36 2016 -0700

----------------------------------------------------------------------
 .../source/atlas/AtlasHiveResourceMapper.java   | 29 ++++++--------------
 1 file changed, 9 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/8d353cb4/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasHiveResourceMapper.java
----------------------------------------------------------------------
diff --git a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasHiveResourceMapper.java
b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasHiveResourceMapper.java
index a318f3b..ca7b063 100644
--- a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasHiveResourceMapper.java
+++ b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasHiveResourceMapper.java
@@ -45,8 +45,6 @@ public class AtlasHiveResourceMapper extends AtlasResourceMapper {
 	public static final String RANGER_TYPE_HIVE_TABLE = "table";
 	public static final String RANGER_TYPE_HIVE_COLUMN = "column";
 
-	public static final String ENTITY_ATTRIBUTE_QUALIFIED_NAME_FOR_HIVE_TABLE = "name";
-
 	public static final String ENTITY_ATTRIBUTE_QUALIFIED_NAME = "qualifiedName";
 
 	public static final String TAGSYNC_DEFAULT_CLUSTERNAME_AND_COMPONENTNAME_SEPARATOR = "_";
@@ -147,10 +145,17 @@ public class AtlasHiveResourceMapper extends AtlasResourceMapper {
 
 	public final List<String> getQualifiedNameComponents(IReferenceableInstance entity)
throws Exception {
 
-		String qualifiedNameAttributeName = getQualifiedNameAttributeName(entity.getTypeName());
-
+		String qualifiedNameAttributeName = ENTITY_ATTRIBUTE_QUALIFIED_NAME;
 		String qualifiedName = getEntityAttribute(entity, qualifiedNameAttributeName, String.class);
 
+		if (StringUtils.isBlank(qualifiedName)) {
+			throw new Exception("Could not get a valid value for " + qualifiedNameAttributeName +
" attribute from entity.");
+		}
+
+		if (LOG.isDebugEnabled()) {
+			LOG.debug("Received .... " + qualifiedNameAttributeName + "=" + qualifiedName + " for
entity type " + entity.getTypeName());
+		}
+
 		List<String> ret = getQualifiedNameComponents(entity.getTypeName(), qualifiedName);
 
 		if (LOG.isDebugEnabled()) {
@@ -167,16 +172,6 @@ public class AtlasHiveResourceMapper extends AtlasResourceMapper {
 
 	public final List<String> getQualifiedNameComponents(String entityTypeName, String
qualifiedName) throws Exception {
 
-		String qualifiedNameAttributeName = getQualifiedNameAttributeName(entityTypeName);
-
-		if (StringUtils.isBlank(qualifiedName)) {
-			throw new Exception("Could not get a valid value for " + qualifiedNameAttributeName +
" attribute from entity.");
-		}
-
-		if (LOG.isDebugEnabled()) {
-			LOG.debug("Received .... " + qualifiedNameAttributeName + "=" + qualifiedName + " for
entity type " + entityTypeName);
-		}
-
 		String components[] = qualifiedName.split(clusterDelimiter);
 
 		if (components.length != 2) {
@@ -198,10 +193,4 @@ public class AtlasHiveResourceMapper extends AtlasResourceMapper {
 
 		return ret;
 	}
-
-	public String getQualifiedNameAttributeName(String entityTypeName) {
-		return  StringUtils.equals(entityTypeName, ENTITY_TYPE_HIVE_TABLE) ?
-				ENTITY_ATTRIBUTE_QUALIFIED_NAME_FOR_HIVE_TABLE : ENTITY_ATTRIBUTE_QUALIFIED_NAME;
-	}
-
 }


Mime
View raw message