This is an automated email from the ASF dual-hosted git repository.
amestry pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 500ea95 ATLAS-3902: Import Service: UpdateVertexGuid Now Makes
Updates to AtlasEntityWithExtInfo
500ea95 is described below
commit 500ea95c3e2fbaa231026959304fa6f7ade055be
Author: Ashutosh Mestry <[email protected]>
AuthorDate: Fri Jul 24 08:44:50 2020 -0700
ATLAS-3902: Import Service: UpdateVertexGuid Now Makes Updates to
AtlasEntityWithExtInfo
---
.../repository/store/graph/v2/bulkimport/RegularImport.java | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/bulkimport/RegularImport.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/bulkimport/RegularImport.java
index 3f7e861..eca6b0e 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/bulkimport/RegularImport.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/bulkimport/RegularImport.java
@@ -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);