Repository: atlas
Updated Branches:
  refs/heads/master 8d1e72234 -> 0cde9f921


ATLAS-2550: On deleting entity with classification , classification is removed 
from the entity, but search on classification lists the entity


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

Branch: refs/heads/master
Commit: 0cde9f92136979c58ebb0bc282e9f74a247f4b50
Parents: 8d1e722
Author: Sarath Subramanian <ssubraman...@hortonworks.com>
Authored: Mon Apr 9 15:10:43 2018 -0700
Committer: Sarath Subramanian <ssubraman...@hortonworks.com>
Committed: Mon Apr 9 15:10:54 2018 -0700

----------------------------------------------------------------------
 .../apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/0cde9f92/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
index 6386bcb..2b6863a 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/DeleteHandlerV1.java
@@ -51,6 +51,7 @@ import static 
org.apache.atlas.model.instance.AtlasClassification.PropagationSta
 import static org.apache.atlas.model.instance.AtlasEntity.Status.DELETED;
 import static org.apache.atlas.repository.Constants.CLASSIFICATION_LABEL;
 import static 
org.apache.atlas.repository.Constants.PROPAGATED_TRAIT_NAMES_PROPERTY_KEY;
+import static org.apache.atlas.repository.Constants.TRAIT_NAMES_PROPERTY_KEY;
 import static org.apache.atlas.repository.graph.GraphHelper.EDGE_LABEL_PREFIX;
 import static 
org.apache.atlas.repository.graph.GraphHelper.addToPropagatedTraitNames;
 import static 
org.apache.atlas.repository.graph.GraphHelper.getClassificationEdgeState;
@@ -498,6 +499,10 @@ public abstract class DeleteHandlerV1 {
         for (AtlasEdge edge : classificationEdges) {
             deleteEdgeReference(edge, TypeCategory.CLASSIFICATION, false, 
false, instanceVertex);
         }
+
+        //remove traitNames and propagatedTraitNames property from 
instanceVertex
+        instanceVertex.removeProperty(TRAIT_NAMES_PROPERTY_KEY);
+        instanceVertex.removeProperty(PROPAGATED_TRAIT_NAMES_PROPERTY_KEY);
     }
 
     protected AtlasAttribute getAttributeForEdge(String edgeLabel) throws 
AtlasBaseException {

Reply via email to