atlas-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From svimal2...@apache.org
Subject incubator-atlas git commit: Atlas server fails to start if duplicate types are found during Typesystem bootstrap
Date Fri, 10 Feb 2017 09:13:26 GMT
Repository: incubator-atlas
Updated Branches:
  refs/heads/0.7-incubating d94a516ba -> 80f9e73ca


Atlas server fails to start if duplicate types are found during Typesystem bootstrap


Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/80f9e73c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/80f9e73c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/80f9e73c

Branch: refs/heads/0.7-incubating
Commit: 80f9e73caad70aeae19e366233e40d7af11595b8
Parents: d94a516
Author: Vimal Sharma <svimal2106@apache.org>
Authored: Fri Feb 10 14:42:47 2017 +0530
Committer: Vimal Sharma <svimal2106@apache.org>
Committed: Fri Feb 10 14:42:47 2017 +0530

----------------------------------------------------------------------
 release-log.txt                                         |  1 +
 .../org/apache/atlas/typesystem/types/TypeSystem.java   | 12 ++++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/80f9e73c/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 4a82306..470b085 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -32,6 +32,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file
(dosset
 ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via
shwethags)
 
 ALL CHANGES:
+ATLAS-1542 Atlas server fails to start if duplicate types are found during Typesystem bootstrap
(svimal2106)
 ATLAS-1442 updated pom.xml to change version number to 0.7.1-incubating (mneethiraj)
 ATLAS-1432 Responsive Loader and css changes (kevalbhatt via mneethiraj)
 ATLAS-1427 update tests for the changes in default SSL protocols support (mneethiraj)

http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/80f9e73c/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
index 70ba89b..e6c1f99 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
@@ -405,7 +405,8 @@ public class TypeSystem {
             for (EnumTypeDefinition eDef : enumDefs) {
                 assert eDef.name != null;
                 if (!update && isRegistered(eDef.name)) {
-                    throw new AtlasException(String.format("Redefinition of type %s not supported",
eDef.name));
+                    LOG.warn("Found duplicate definition of type {}. Ignoring..", eDef.name);
+                    continue;
                 }
 
                 EnumType eT = new EnumType(this, eDef.name, eDef.description, eDef.enumValues);
@@ -415,7 +416,8 @@ public class TypeSystem {
             for (StructTypeDefinition sDef : structDefs) {
                 assert sDef.typeName != null;
                 if (!update && isRegistered(sDef.typeName)) {
-                    throw new TypeExistsException(String.format("Cannot redefine type %s",
sDef.typeName));
+                    LOG.warn("Found duplicate definition of type {}. Ignoring..", sDef.typeName);
+                    continue;
                 }
                 StructType sT = new StructType(this, sDef.typeName, sDef.typeDescription,
sDef.attributeDefinitions.length);
                 structNameToDefMap.put(sDef.typeName, sDef);
@@ -425,7 +427,8 @@ public class TypeSystem {
             for (HierarchicalTypeDefinition<TraitType> traitDef : traitDefs) {
                 assert traitDef.typeName != null;
                 if (!update && isRegistered(traitDef.typeName)) {
-                    throw new TypeExistsException(String.format("Cannot redefine type %s",
traitDef.typeName));
+                    LOG.warn("Found duplicate definition of type {}. Ignoring..", traitDef.typeName);
+                    continue;
                 }
                 TraitType tT = new TraitType(this, traitDef.typeName, traitDef.typeDescription,
traitDef.superTypes,
                         traitDef.attributeDefinitions.length);
@@ -436,7 +439,8 @@ public class TypeSystem {
             for (HierarchicalTypeDefinition<ClassType> classDef : classDefs) {
                 assert classDef.typeName != null;
                 if (!update && isRegistered(classDef.typeName)) {
-                    throw new TypeExistsException(String.format("Cannot redefine type %s",
classDef.typeName));
+                    LOG.warn("Found duplicate definition of type {}. Ignoring..", classDef.typeName);
+                    continue;
                 }
 
                 ClassType cT = new ClassType(this, classDef.typeName, classDef.typeDescription,
classDef.superTypes,


Mime
View raw message