Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
617bc25e
Commit
617bc25e
authored
8 years ago
by
David Radley
Committed by
Madhan Neethiraj
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1899: fixup the logic around edge creation for relationshipDefs
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
958c48c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
9 deletions
+9
-9
AtlasRelationshipDefStoreV1.java
...epository/store/graph/v1/AtlasRelationshipDefStoreV1.java
+9
-9
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
View file @
617bc25e
...
...
@@ -84,7 +84,6 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
final
String
type2
=
endDef2
.
getType
();
final
String
name1
=
endDef1
.
getName
();
final
String
name2
=
endDef2
.
getName
();
AtlasVertex
end1TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type1
);
AtlasVertex
end2TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type2
);
...
...
@@ -96,22 +95,23 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
We are not invoking the equals method on the AtlasRelationshipedDef, as we only want 1 edge even if propagateTags or other properties are different.
*/
if
(!
type1
.
equals
(
type2
)
&&
name1
.
equals
(
name2
))
{
AtlasEdge
edge2
=
typeDefStore
.
getOrCreateEdge
(
relationshipDefVertex
,
end2TypeVertex
,
AtlasGraphUtilsV1
.
RELATIONSHIPTYPE_EDGE_LABEL
);
if
(
type1
.
equals
(
type2
)
&&
name1
.
equals
(
name2
))
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasRelationshipDefStoreV1.preCreate({}): created relationshipDef vertex {},"
+
" edge1 as {}, edge2 as {} "
,
relationshipDef
,
relationshipDefVertex
,
edge1
,
edge2
);
" and one edge as {}, because end1 and end2 have the same type and name"
,
relationshipDef
,
relationshipDefVertex
,
edge1
);
}
}
else
{
AtlasEdge
edge2
=
typeDefStore
.
getOrCreateEdge
(
relationshipDefVertex
,
end2TypeVertex
,
AtlasGraphUtilsV1
.
RELATIONSHIPTYPE_EDGE_LABEL
);
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"AtlasRelationshipDefStoreV1.preCreate({}): created relationshipDef vertex {},"
+
" and one edge as {} , because end1 and and end2 has same type and name"
,
relationshipDef
,
relationshipDefVertex
,
edge1
);
" edge1 as {}, edge2 as {} "
,
relationshipDef
,
relationshipDefVertex
,
edge1
,
edge2
);
}
}
LOG
.
debug
(
"<== AtlasRelationshipDefStoreV1.preCreate({}): {}"
,
relationshipDef
,
relationshipDefVertex
);
}
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"<== AtlasRelationshipDefStoreV1.preCreate({}): {}"
,
relationshipDef
,
relationshipDefVertex
);
}
return
relationshipDefVertex
;
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment