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
a910609d
Commit
a910609d
authored
Apr 14, 2019
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3136: assigning a term to an invalid entity guid throws 500, instead of 400
parent
06a3fd3f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
AtlasRelationshipStore.java
.../atlas/repository/store/graph/AtlasRelationshipStore.java
+1
-1
AtlasRelationshipStoreV2.java
...s/repository/store/graph/v2/AtlasRelationshipStoreV2.java
+15
-2
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasRelationshipStore.java
View file @
a910609d
...
@@ -59,7 +59,7 @@ public interface AtlasRelationshipStore {
...
@@ -59,7 +59,7 @@ public interface AtlasRelationshipStore {
AtlasEdge
getOrCreate
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
;
AtlasEdge
getOrCreate
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
;
AtlasEdge
getRelationship
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
);
AtlasEdge
getRelationship
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
;
AtlasEdge
createRelationship
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
;
AtlasEdge
createRelationship
(
AtlasVertex
end1Vertex
,
AtlasVertex
end2Vertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
;
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasRelationshipStoreV2.java
View file @
a910609d
...
@@ -294,7 +294,7 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
...
@@ -294,7 +294,7 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
}
}
@Override
@Override
public
AtlasEdge
getRelationship
(
AtlasVertex
fromVertex
,
AtlasVertex
toVertex
,
AtlasRelationship
relationship
)
{
public
AtlasEdge
getRelationship
(
AtlasVertex
fromVertex
,
AtlasVertex
toVertex
,
AtlasRelationship
relationship
)
throws
AtlasBaseException
{
String
relationshipLabel
=
getRelationshipEdgeLabel
(
fromVertex
,
toVertex
,
relationship
.
getTypeName
());
String
relationshipLabel
=
getRelationshipEdgeLabel
(
fromVertex
,
toVertex
,
relationship
.
getTypeName
());
return
getRelationshipEdge
(
fromVertex
,
toVertex
,
relationshipLabel
);
return
getRelationshipEdge
(
fromVertex
,
toVertex
,
relationshipLabel
);
...
@@ -802,12 +802,25 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
...
@@ -802,12 +802,25 @@ public class AtlasRelationshipStoreV2 implements AtlasRelationshipStore {
return
ret
;
return
ret
;
}
}
private
String
getRelationshipEdgeLabel
(
AtlasVertex
fromVertex
,
AtlasVertex
toVertex
,
String
relationshipTypeName
)
{
private
String
getRelationshipEdgeLabel
(
AtlasVertex
fromVertex
,
AtlasVertex
toVertex
,
String
relationshipTypeName
)
throws
AtlasBaseException
{
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"getRelationshipEdgeLabel({})"
,
relationshipTypeName
);
LOG
.
debug
(
"getRelationshipEdgeLabel({})"
,
relationshipTypeName
);
}
}
AtlasRelationshipType
relationshipType
=
typeRegistry
.
getRelationshipTypeByName
(
relationshipTypeName
);
AtlasRelationshipType
relationshipType
=
typeRegistry
.
getRelationshipTypeByName
(
relationshipTypeName
);
if
(
relationshipType
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_VALUE
,
"unknown relationship type'"
+
relationshipTypeName
+
"'"
);
}
if
(
fromVertex
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIP_END_IS_NULL
,
relationshipType
.
getEnd1Type
().
getTypeName
());
}
if
(
toVertex
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIP_END_IS_NULL
,
relationshipType
.
getEnd2Type
().
getTypeName
());
}
String
ret
=
relationshipType
.
getRelationshipLabel
();
String
ret
=
relationshipType
.
getRelationshipLabel
();
AtlasRelationshipEndDef
endDef1
=
relationshipType
.
getRelationshipDef
().
getEndDef1
();
AtlasRelationshipEndDef
endDef1
=
relationshipType
.
getRelationshipDef
().
getEndDef1
();
AtlasRelationshipEndDef
endDef2
=
relationshipType
.
getRelationshipDef
().
getEndDef2
();
AtlasRelationshipEndDef
endDef2
=
relationshipType
.
getRelationshipDef
().
getEndDef2
();
...
...
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