Commit 2a441bec by Shwetha GS

ATLAS-1203 'Invalid type definition' due to no new types to be created at…

ATLAS-1203 'Invalid type definition' due to no new types to be created at startup (mneethiraj via shwethags)
parent 698a5652
......@@ -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-1203 'Invalid type definition' due to no new types to be created at startup (mneethiraj via shwethags)
ATLAS-1171 Structured, high-level public APIs (mneethiraj via shwethags)
ATLAS-247 Hive Column level lineage (rhbutani,svimal2106 via shwethags)
ATLAS-1184 ReservedTypesRegistrar checks for existence of 1st class type (svimal2106 via shwethags)
......
......@@ -68,7 +68,10 @@ public class ReservedTypesRegistrar implements IBootstrapTypesRegistrar {
String typeDefJSON = new String(Files.readAllBytes(typeDefFile.toPath()), StandardCharsets.UTF_8);
registerType(typeSystem, metadataService, typeDefFile.getAbsolutePath(), typeDefJSON);
} catch (IOException e) {
e.printStackTrace();
LOG.error("error while registering types in file " + typeDefFile.getAbsolutePath(), e);
} catch (AtlasException e) {
LOG.error("error while registering types in file " + typeDefFile.getAbsolutePath(), e);
throw e;
}
}
......@@ -119,10 +122,12 @@ public class ReservedTypesRegistrar implements IBootstrapTypesRegistrar {
TypesDef createTypes = TypesUtil.getTypesDef(ImmutableList.copyOf(createEnumDefList), ImmutableList.copyOf(createStructDefList),
ImmutableList.copyOf(createTraitDefList), ImmutableList.copyOf(createClassDefList));
String createTypeJSON = TypesSerialization.toJson(createTypes);
if(createTypeJSON != null) {
metadataService.createType(createTypeJSON);
LOG.info("Created types definition JSON {}", createTypeJSON);
if (! createTypes.isEmpty()) {
String createTypeJSON = TypesSerialization.toJson(createTypes);
if (createTypeJSON != null) {
metadataService.createType(createTypeJSON);
LOG.info("Created types definition JSON {}", createTypeJSON);
}
}
}
}
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