Commit 30a8e228 by Vimal Sharma

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

parent 0fe4d885
...@@ -9,6 +9,7 @@ ATLAS-1060 Add composite indexes for exact match performance improvements for al ...@@ -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) ATLAS-1127 Modify creation and modification timestamps to Date instead of Long(sumasai)
ALL CHANGES: 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-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-1401 Document in detail how to set up Eclipse for Atlas dev environment
ATLAS-1527 Batch entity retrievals - DefaultMetadataService.loadEntities (wojciechwojcik via jnhagelberg) ATLAS-1527 Batch entity retrievals - DefaultMetadataService.loadEntities (wojciechwojcik via jnhagelberg)
......
...@@ -413,7 +413,8 @@ public class TypeSystem { ...@@ -413,7 +413,8 @@ public class TypeSystem {
for (EnumTypeDefinition eDef : enumDefs) { for (EnumTypeDefinition eDef : enumDefs) {
assert eDef.name != null; assert eDef.name != null;
if (!update && isRegistered(eDef.name)) { 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); EnumType eT = new EnumType(this, eDef.name, eDef.description, eDef.version, eDef.enumValues);
...@@ -423,7 +424,8 @@ public class TypeSystem { ...@@ -423,7 +424,8 @@ public class TypeSystem {
for (StructTypeDefinition sDef : structDefs) { for (StructTypeDefinition sDef : structDefs) {
assert sDef.typeName != null; assert sDef.typeName != null;
if (!update && isRegistered(sDef.typeName)) { 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); StructType sT = new StructType(this, sDef.typeName, sDef.typeDescription, sDef.typeVersion, sDef.attributeDefinitions.length);
structNameToDefMap.put(sDef.typeName, sDef); structNameToDefMap.put(sDef.typeName, sDef);
...@@ -433,7 +435,8 @@ public class TypeSystem { ...@@ -433,7 +435,8 @@ public class TypeSystem {
for (HierarchicalTypeDefinition<TraitType> traitDef : traitDefs) { for (HierarchicalTypeDefinition<TraitType> traitDef : traitDefs) {
assert traitDef.typeName != null; assert traitDef.typeName != null;
if (!update && isRegistered(traitDef.typeName)) { 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, TraitType tT = new TraitType(this, traitDef.typeName, traitDef.typeDescription, traitDef.typeVersion, traitDef.superTypes,
traitDef.attributeDefinitions.length); traitDef.attributeDefinitions.length);
...@@ -444,7 +447,8 @@ public class TypeSystem { ...@@ -444,7 +447,8 @@ public class TypeSystem {
for (HierarchicalTypeDefinition<ClassType> classDef : classDefs) { for (HierarchicalTypeDefinition<ClassType> classDef : classDefs) {
assert classDef.typeName != null; assert classDef.typeName != null;
if (!update && isRegistered(classDef.typeName)) { 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, ClassType cT = new ClassType(this, classDef.typeName, classDef.typeDescription, classDef.typeVersion, classDef.superTypes,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment