use of org.apache.atlas.repository.RepositoryException in project incubator-atlas by apache.
the class ClassStore method createInstance.
/*
* - assumes id is already validated
*/
ReferenceableInstance createInstance(MemRepository repo, Id id) throws RepositoryException {
Integer pos = idPosMap.get(id);
String typeName = typeNameList.get(pos);
if (!Objects.equals(typeName, hierarchicalType.getName())) {
return repo.getClassStore(typeName).createInstance(repo, id);
}
ImmutableList<String> traitNames = traitNamesStore.get(pos);
String[] tNs = traitNames.toArray(new String[] {});
try {
return (ReferenceableInstance) classType.createInstance(id, tNs);
} catch (AtlasException me) {
throw new RepositoryException(me);
}
}
Aggregations