Commit 30334742 by Venkatesh Seetharam

BUG-38738 restore types fails

parent 6e9d6948
...@@ -90,11 +90,12 @@ public class DefaultMetadataService implements MetadataService { ...@@ -90,11 +90,12 @@ public class DefaultMetadataService implements MetadataService {
private void restoreTypeSystem() { private void restoreTypeSystem() {
LOG.info("Restoring type system from the store"); LOG.info("Restoring type system from the store");
try { try {
createSuperTypes();
TypesDef typesDef = typeStore.restore(); TypesDef typesDef = typeStore.restore();
typeSystem.defineTypes(typesDef); typeSystem.defineTypes(typesDef);
// restore types before creating super types
createSuperTypes();
} catch (MetadataException e) { } catch (MetadataException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
...@@ -107,7 +108,7 @@ public class DefaultMetadataService implements MetadataService { ...@@ -107,7 +108,7 @@ public class DefaultMetadataService implements MetadataService {
TypesUtil.createOptionalAttrDef("description", DataTypes.STRING_TYPE); TypesUtil.createOptionalAttrDef("description", DataTypes.STRING_TYPE);
@InterfaceAudience.Private @InterfaceAudience.Private
public void createSuperTypes() throws MetadataException { private void createSuperTypes() throws MetadataException {
if (typeSystem.isRegistered(MetadataServiceClient.DATA_SET_SUPER_TYPE)) { if (typeSystem.isRegistered(MetadataServiceClient.DATA_SET_SUPER_TYPE)) {
return; // this is already registered return; // this is already registered
} }
......
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