Repository: incubator-atlas Updated Branches: refs/heads/master 0fe4d8854 -> 30a8e2281
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/30a8e228 Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/30a8e228 Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/30a8e228 Branch: refs/heads/master Commit: 30a8e228119ee0141ad5d8fd9912f9ea5b4be0a2 Parents: 0fe4d88 Author: Vimal Sharma <[email protected]> Authored: Fri Feb 10 14:30:35 2017 +0530 Committer: Vimal Sharma <[email protected]> Committed: Fri Feb 10 14:30:35 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/30a8e228/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index d544833..91dbbd3 100644 --- a/release-log.txt +++ b/release-log.txt @@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai) ALL CHANGES: +ATLAS-1542 Atlas server fails to start if duplicate types are found during Typesystem bootstrap (svimal2106) ATLAS-1535 Some webapp tests are failing due to a stale Titan transaction (jnhagelberg) ATLAS-1401 Document in detail how to set up Eclipse for Atlas dev environment ATLAS-1527 Batch entity retrievals - DefaultMetadataService.loadEntities (wojciechwojcik via jnhagelberg) http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/30a8e228/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 3d33b7f..119a8d5 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 @@ -413,7 +413,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.version, eDef.enumValues); @@ -423,7 +424,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.typeVersion, sDef.attributeDefinitions.length); structNameToDefMap.put(sDef.typeName, sDef); @@ -433,7 +435,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.typeVersion, traitDef.superTypes, traitDef.attributeDefinitions.length); @@ -444,7 +447,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.typeVersion, classDef.superTypes,
