Commit 54bab3f8 by Ashutosh Mestry

ATLAS-3977: Patch handler for addressing deleted entities after migration.

parent 8bb3e853
...@@ -18,12 +18,14 @@ ...@@ -18,12 +18,14 @@
package org.apache.atlas.repository.patches; package org.apache.atlas.repository.patches;
import org.apache.atlas.exception.AtlasBaseException; import org.apache.atlas.exception.AtlasBaseException;
import org.apache.atlas.model.instance.AtlasEntity;
import org.apache.atlas.pc.WorkItemManager; import org.apache.atlas.pc.WorkItemManager;
import org.apache.atlas.repository.Constants; import org.apache.atlas.repository.Constants;
import org.apache.atlas.repository.graphdb.AtlasEdge; import org.apache.atlas.repository.graphdb.AtlasEdge;
import org.apache.atlas.repository.graphdb.AtlasEdgeDirection; import org.apache.atlas.repository.graphdb.AtlasEdgeDirection;
import org.apache.atlas.repository.graphdb.AtlasGraph; import org.apache.atlas.repository.graphdb.AtlasGraph;
import org.apache.atlas.repository.graphdb.AtlasVertex; 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.AtlasClassificationType;
import org.apache.atlas.type.AtlasEntityType; import org.apache.atlas.type.AtlasEntityType;
import org.apache.atlas.type.AtlasTypeRegistry; import org.apache.atlas.type.AtlasTypeRegistry;
...@@ -120,6 +122,10 @@ public class ClassificationTextPatch extends AtlasPatchHandler { ...@@ -120,6 +122,10 @@ public class ClassificationTextPatch extends AtlasPatchHandler {
LOG.debug("processItem(typeName={}, vertexId={})", typeName, vertexId); LOG.debug("processItem(typeName={}, vertexId={})", typeName, vertexId);
} }
if (AtlasGraphUtilsV2.getState(vertex) != AtlasEntity.Status.ACTIVE) {
return;
}
getEntityGraphMapper().updateClassificationTextAndNames(vertex); getEntityGraphMapper().updateClassificationTextAndNames(vertex);
if(LOG.isDebugEnabled()) { if(LOG.isDebugEnabled()) {
......
...@@ -204,10 +204,6 @@ public abstract class ConcurrentPatchProcessor { ...@@ -204,10 +204,6 @@ public abstract class ConcurrentPatchProcessor {
return; return;
} }
if (AtlasGraphUtilsV2.getState(vertex) != AtlasEntity.Status.ACTIVE) {
return;
}
String typeName = AtlasGraphUtilsV2.getTypeName(vertex); String typeName = AtlasGraphUtilsV2.getTypeName(vertex);
AtlasEntityType entityType = typeRegistry.getEntityTypeByName(typeName); AtlasEntityType entityType = typeRegistry.getEntityTypeByName(typeName);
if (entityType == null) { if (entityType == null) {
......
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