Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 0225cad56 -> c562db174


ATLAS-2129: Addressed Case Where Abrupt Shutdown of Atlas During Import Retains 
Entities Imported Before Shutdown


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

Branch: refs/heads/branch-0.8
Commit: c562db1748b272330a83c46a4685fb69959c30f2
Parents: 0225cad
Author: ashutoshm <ames...@hortonworks.com>
Authored: Tue Sep 12 20:26:29 2017 -0700
Committer: ashutoshm <ames...@hortonworks.com>
Committed: Tue Sep 12 20:31:41 2017 -0700

----------------------------------------------------------------------
 .../atlas/repository/store/graph/v1/AtlasEntityStoreV1.java  | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/c562db17/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
index 1c168b4..dc6416a 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasEntityStoreV1.java
@@ -147,7 +147,6 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore 
{
     }
 
     @Override
-    @GraphTransaction
     public EntityMutationResponse bulkImport(EntityImportStream entityStream, 
AtlasImportResult importResult) throws AtlasBaseException {
         if (LOG.isDebugEnabled()) {
             LOG.debug("==> bulkImport()");
@@ -175,7 +174,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore 
{
 
             AtlasEntityStreamForImport oneEntityStream = new 
AtlasEntityStreamForImport(entityWithExtInfo, entityStream);
             try {
-                EntityMutationResponse resp = createOrUpdate(oneEntityStream, 
false, true);
+                EntityMutationResponse resp = 
createOrUpdateForImport(oneEntityStream);
 
                 if (resp.getGuidAssignments() != null) {
                     ret.getGuidAssignments().putAll(resp.getGuidAssignments());
@@ -288,6 +287,11 @@ public class AtlasEntityStoreV1 implements 
AtlasEntityStore {
         return createOrUpdate(entityStream, isPartialUpdate, false);
     }
 
+    @GraphTransaction
+    private EntityMutationResponse createOrUpdateForImport(EntityStream 
entityStream) throws AtlasBaseException {
+        return createOrUpdate(entityStream, false, true);
+    }
+
     @Override
     @GraphTransaction
     public EntityMutationResponse updateByUniqueAttributes(AtlasEntityType 
entityType, Map<String, Object> uniqAttributes,

Reply via email to