mneethiraj commented on code in PR #312:
URL: https://github.com/apache/atlas/pull/312#discussion_r2007977853
##########
repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java:
##########
@@ -112,27 +117,51 @@ public AtlasExportResult run(ZipSink exportSink,
AtlasExportRequest request, Str
return context.result;
}
- public void processEntity(AtlasEntityWithExtInfo entityWithExtInfo,
ExportContext context) throws AtlasBaseException {
- exportTypeProcessor.addTypes(entityWithExtInfo.getEntity(), context);
-
+ public void processEntity(ExportContext context, AtlasVertex vertex,
String guid) throws AtlasBaseException {
if (MapUtils.isNotEmpty(context.termsGlossary)) {
addGlossaryEntities(context);
}
- addEntity(entityWithExtInfo, context);
+ addEntity(vertex, guid, context);
- context.guidsProcessed.add(entityWithExtInfo.getEntity().getGuid());
+ context.guidsProcessed.add(guid);
- entitiesExtractor.get(entityWithExtInfo.getEntity(), context);
+ extractFullEntities(vertex, context);
+ }
- if (entityWithExtInfo.getReferredEntities() != null) {
- for (AtlasEntity e :
entityWithExtInfo.getReferredEntities().values()) {
- exportTypeProcessor.addTypes(e, context);
- entitiesExtractor.get(e, context);
+ public void extractFullEntities(AtlasVertex vertex, ExportContext context)
{
+ List<AtlasVertex> relationshipEntities =
entityGraphRetriever.findAllRelationshipVertices(vertex);
+ if (CollectionUtils.isNotEmpty(relationshipEntities)) {
+ for (AtlasVertex e : relationshipEntities) {
+ String relGuid = AtlasGraphUtilsV2.getEncodedProperty(e,
GUID_PROPERTY_KEY, String.class);
+ if (StringUtils.isNotEmpty(relGuid)) {
+ context.guidsToProcess.add(relGuid);
Review Comment:
`relGuid` should be added only if it was already processed.
```
if (!context.guidsProcessed.contains(relGuid)) {
context.guidsToProcess.add(relGuid);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]