Repository: atlas
Updated Branches:
  refs/heads/master 7c80aba28 -> f1f828fdc


ATLAS-2372: Export without relationship attributes.

Signed-off-by: Madhan Neethiraj <mad...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/f1f828fd
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/f1f828fd
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/f1f828fd

Branch: refs/heads/master
Commit: f1f828fdc58b87cd4fcf51c3c10e9c5a34216a5a
Parents: 7c80aba
Author: Ashutosh Mestry <ames...@hortonworks.com>
Authored: Wed Jan 17 14:25:53 2018 -0800
Committer: Madhan Neethiraj <mad...@apache.org>
Committed: Wed Jan 17 21:51:50 2018 -0800

----------------------------------------------------------------------
 .../org/apache/atlas/repository/impexp/ExportService.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/f1f828fd/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
index ca8a106..74d9180 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/impexp/ExportService.java
@@ -442,6 +442,7 @@ public class ExportService {
             return;
         }
 
+        removeRelationshipAttributes(entity);
         context.sink.add(entity);
 
         context.result.incrementMeticsCounter(String.format("entity:%s", 
entity.getEntity().getTypeName()));
@@ -455,6 +456,15 @@ public class ExportService {
         context.reportProgress();
     }
 
+    private void removeRelationshipAttributes(AtlasEntityWithExtInfo entity) {
+        entity.getEntity().getRelationshipAttributes().clear();
+        if(entity.getReferredEntities() != null) {
+            for (AtlasEntity e: entity.getReferredEntities().values()) {
+                e.getRelationshipAttributes().clear();
+            }
+        }
+    }
+
     private void addTypes(AtlasEntity entity, ExportContext context) {
         addEntityType(entity.getTypeName(), context);
 

Reply via email to