This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new eb641d5 ATLAS-3863: Avoid re-evaluating tag propagation when deleting
relationship (edge)
eb641d5 is described below
commit eb641d560e1537808df172aad11f1338cc0e5e7f
Author: Sarath Subramanian <[email protected]>
AuthorDate: Wed Jun 24 17:33:04 2020 -0700
ATLAS-3863: Avoid re-evaluating tag propagation when deleting relationship
(edge)
---
.../org/apache/atlas/repository/graph/GraphHelper.java | 18 ++----------------
.../repository/store/graph/v1/DeleteHandlerV1.java | 7 +------
2 files changed, 3 insertions(+), 22 deletions(-)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
index 7b7ec65..ca46d0f 100755
---
a/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
+++
b/repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
@@ -407,22 +407,8 @@ public final class GraphHelper {
return ret;
}
- public static List<AtlasEdge> getIncomingClassificationEdges(AtlasVertex
classificationVertex) {
- List<AtlasEdge> ret = new ArrayList<>();
- String classificationName = getTypeName(classificationVertex);
- Iterable edges =
classificationVertex.query().direction(AtlasEdgeDirection.IN).label(CLASSIFICATION_LABEL)
-
.has(CLASSIFICATION_EDGE_NAME_PROPERTY_KEY, classificationName).edges();
- if (edges != null) {
- Iterator<AtlasEdge> iterator = edges.iterator();
-
- while (iterator.hasNext()) {
- AtlasEdge edge = iterator.next();
-
- ret.add(edge);
- }
- }
-
- return ret;
+ public static boolean hasEntityReferences(AtlasVertex
classificationVertex) {
+ return classificationVertex.hasEdges(AtlasEdgeDirection.IN,
CLASSIFICATION_LABEL);
}
public static List<AtlasVertex> getAllPropagatedEntityVertices(AtlasVertex
classificationVertex) {
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 3f8503a..717310d 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
@@ -156,9 +156,6 @@ public abstract class DeleteHandlerV1 {
continue;
}
- // re-evaluate tag propagation
- removeTagPropagation(edge);
-
deleteEdge(edge, isInternal || forceDelete);
}
}
@@ -974,10 +971,8 @@ public abstract class DeleteHandlerV1 {
LOG.debug("Deleting classification vertex",
string(classificationVertex));
}
- List<AtlasEdge> incomingClassificationEdges =
getIncomingClassificationEdges(classificationVertex);
-
// delete classification vertex only if it has no more entity
references (direct or propagated)
- if (CollectionUtils.isEmpty(incomingClassificationEdges)) {
+ if (!hasEntityReferences(classificationVertex)) {
_deleteVertex(classificationVertex, force);
}
}