Skip to content

Commit 826f32d

Browse files
ATLAS-5024: Improve fetching edges of the vertex (#338)
Co-authored-by: amruth <amruth.s@cloudera.com>
1 parent ce22cf0 commit 826f32d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,14 +1142,13 @@ public AtlasEdge getOrCreateEdge(AtlasVertex outVertex, AtlasVertex inVertex, St
11421142

11431143
for (int numRetries = 0; numRetries < maxRetries; numRetries++) {
11441144
try {
1145-
LOG.debug("Running edge creation attempt {}", numRetries);
1146-
1147-
if (inVertex.hasEdges(AtlasEdgeDirection.IN, edgeLabel) && outVertex.hasEdges(AtlasEdgeDirection.OUT, edgeLabel)) {
1148-
AtlasEdge edge = graph.getEdgeBetweenVertices(outVertex, inVertex, edgeLabel);
1145+
if (LOG.isDebugEnabled()) {
1146+
LOG.debug("Running edge creation attempt {}", numRetries);
1147+
}
11491148

1150-
if (edge != null) {
1151-
return edge;
1152-
}
1149+
AtlasEdge edge = graph.getEdgeBetweenVertices(outVertex, inVertex, edgeLabel);
1150+
if (edge != null) {
1151+
return edge;
11531152
}
11541153

11551154
return addEdge(outVertex, inVertex, edgeLabel);

0 commit comments

Comments
 (0)