Commit 636a6213 by ashutoshm

ATLAS-2129: Addressed Case Where Abrupt Shutdown of Atlas During Import Retains…

ATLAS-2129: Addressed Case Where Abrupt Shutdown of Atlas During Import Retains Entities Imported Before Shutdown
parent 2acf41fd
...@@ -147,7 +147,6 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { ...@@ -147,7 +147,6 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
} }
@Override @Override
@GraphTransaction
public EntityMutationResponse bulkImport(EntityImportStream entityStream, AtlasImportResult importResult) throws AtlasBaseException { public EntityMutationResponse bulkImport(EntityImportStream entityStream, AtlasImportResult importResult) throws AtlasBaseException {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("==> bulkImport()"); LOG.debug("==> bulkImport()");
...@@ -175,7 +174,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { ...@@ -175,7 +174,7 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
AtlasEntityStreamForImport oneEntityStream = new AtlasEntityStreamForImport(entityWithExtInfo, entityStream); AtlasEntityStreamForImport oneEntityStream = new AtlasEntityStreamForImport(entityWithExtInfo, entityStream);
try { try {
EntityMutationResponse resp = createOrUpdate(oneEntityStream, false, true); EntityMutationResponse resp = createOrUpdateForImport(oneEntityStream);
if (resp.getGuidAssignments() != null) { if (resp.getGuidAssignments() != null) {
ret.getGuidAssignments().putAll(resp.getGuidAssignments()); ret.getGuidAssignments().putAll(resp.getGuidAssignments());
...@@ -288,6 +287,11 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore { ...@@ -288,6 +287,11 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
return createOrUpdate(entityStream, isPartialUpdate, false); return createOrUpdate(entityStream, isPartialUpdate, false);
} }
@GraphTransaction
private EntityMutationResponse createOrUpdateForImport(EntityStream entityStream) throws AtlasBaseException {
return createOrUpdate(entityStream, false, true);
}
@Override @Override
@GraphTransaction @GraphTransaction
public EntityMutationResponse updateByUniqueAttributes(AtlasEntityType entityType, Map<String, Object> uniqAttributes, public EntityMutationResponse updateByUniqueAttributes(AtlasEntityType entityType, Map<String, Object> uniqAttributes,
......
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