Commit 500ea95c by Ashutosh Mestry

ATLAS-3902: Import Service: UpdateVertexGuid Now Makes Updates to AtlasEntityWithExtInfo

parent 9a067d38
......@@ -42,6 +42,7 @@ import org.apache.atlas.repository.store.graph.v2.EntityGraphRetriever;
import org.apache.atlas.repository.store.graph.v2.EntityImportStream;
import org.apache.atlas.type.AtlasEntityType;
import org.apache.atlas.type.AtlasTypeRegistry;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -127,7 +128,7 @@ public class RegularImport extends ImportStrategy {
}
if (attempt == 0) {
updateVertexGuid(entity);
updateVertexGuid(entityWithExtInfo);
} else {
LOG.error("Guid update failed: {}", entityWithExtInfo.getEntity().getGuid());
throw e;
......@@ -153,6 +154,15 @@ public class RegularImport extends ImportStrategy {
}
@GraphTransaction
public void updateVertexGuid(AtlasEntityWithExtInfo entityWithExtInfo) {
updateVertexGuid(entityWithExtInfo.getEntity());
if (MapUtils.isEmpty(entityWithExtInfo.getReferredEntities())) {
return;
}
for (AtlasEntity entity : entityWithExtInfo.getReferredEntities().values()) {
updateVertexGuid(entity);
}
}
public void updateVertexGuid(AtlasEntity entity) {
String entityGuid = entity.getGuid();
AtlasObjectId objectId = entityGraphRetriever.toAtlasObjectIdWithoutGuid(entity);
......
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