You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by am...@apache.org on 2020/10/08 05:26:40 UTC
[atlas] branch branch-2.0 updated: ATLAS-3977: Patch handler for
addressing deleted entities after migration.
This is an automated email from the ASF dual-hosted git repository.
amestry pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 2101d82 ATLAS-3977: Patch handler for addressing deleted entities after migration.
2101d82 is described below
commit 2101d82b05d5aaf03b9e47e910f39777013325f0
Author: Ashutosh Mestry <am...@cloudera.com>
AuthorDate: Wed Oct 7 21:30:17 2020 -0700
ATLAS-3977: Patch handler for addressing deleted entities after migration.
---
.../apache/atlas/repository/patches/ClassificationTextPatch.java | 6 ++++++
.../apache/atlas/repository/patches/ConcurrentPatchProcessor.java | 4 ----
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/repository/src/main/java/org/apache/atlas/repository/patches/ClassificationTextPatch.java b/repository/src/main/java/org/apache/atlas/repository/patches/ClassificationTextPatch.java
index 8351942..a3415c0 100644
--- a/repository/src/main/java/org/apache/atlas/repository/patches/ClassificationTextPatch.java
+++ b/repository/src/main/java/org/apache/atlas/repository/patches/ClassificationTextPatch.java
@@ -18,12 +18,14 @@
package org.apache.atlas.repository.patches;
import org.apache.atlas.exception.AtlasBaseException;
+import org.apache.atlas.model.instance.AtlasEntity;
import org.apache.atlas.pc.WorkItemManager;
import org.apache.atlas.repository.Constants;
import org.apache.atlas.repository.graphdb.AtlasEdge;
import org.apache.atlas.repository.graphdb.AtlasEdgeDirection;
import org.apache.atlas.repository.graphdb.AtlasGraph;
import org.apache.atlas.repository.graphdb.AtlasVertex;
+import org.apache.atlas.repository.store.graph.v2.AtlasGraphUtilsV2;
import org.apache.atlas.type.AtlasClassificationType;
import org.apache.atlas.type.AtlasEntityType;
import org.apache.atlas.type.AtlasTypeRegistry;
@@ -120,6 +122,10 @@ public class ClassificationTextPatch extends AtlasPatchHandler {
LOG.debug("processItem(typeName={}, vertexId={})", typeName, vertexId);
}
+ if (AtlasGraphUtilsV2.getState(vertex) != AtlasEntity.Status.ACTIVE) {
+ return;
+ }
+
getEntityGraphMapper().updateClassificationTextAndNames(vertex);
if(LOG.isDebugEnabled()) {
diff --git a/repository/src/main/java/org/apache/atlas/repository/patches/ConcurrentPatchProcessor.java b/repository/src/main/java/org/apache/atlas/repository/patches/ConcurrentPatchProcessor.java
index 5a9ac2a..c6f0e64 100644
--- a/repository/src/main/java/org/apache/atlas/repository/patches/ConcurrentPatchProcessor.java
+++ b/repository/src/main/java/org/apache/atlas/repository/patches/ConcurrentPatchProcessor.java
@@ -204,10 +204,6 @@ public abstract class ConcurrentPatchProcessor {
return;
}
- if (AtlasGraphUtilsV2.getState(vertex) != AtlasEntity.Status.ACTIVE) {
- return;
- }
-
String typeName = AtlasGraphUtilsV2.getTypeName(vertex);
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(typeName);
if (entityType == null) {