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
ee8c81df
Commit
ee8c81df
authored
Jul 07, 2017
by
David Radley
Committed by
Madhan Neethiraj
Jul 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1912: fix for defects reported by Coverity scan
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
1c4e8b7f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
AtlasErrorCode.java
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
+1
-0
AtlasRelationshipDefStoreV1.java
...epository/store/graph/v1/AtlasRelationshipDefStoreV1.java
+11
-3
No files found.
intg/src/main/java/org/apache/atlas/AtlasErrorCode.java
View file @
ee8c81df
...
...
@@ -100,6 +100,7 @@ public enum AtlasErrorCode {
INSTANCE_NOT_FOUND
(
404
,
"ATLAS-404-00-00B"
,
"Given instance is invalid/not found: {0}"
),
RELATIONSHIP_GUID_NOT_FOUND
(
404
,
"ATLAS-404-00-00C"
,
"Given relationship guid {0} is invalid/not found"
),
RELATIONSHIP_CRUD_INVALID_PARAMS
(
404
,
"ATLAS-404-00-00D"
,
"Invalid relationship creation/updation parameters passed : {0}"
),
RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND
(
404
,
"ATLAS-404-00-00E"
,
"RelationshipDef {0} endDef typename {0} cannot be found"
),
// All data conflict errors go here
TYPE_ALREADY_EXISTS
(
409
,
"ATLAS-409-00-001"
,
"Given type {0} already exists"
),
TYPE_HAS_REFERENCES
(
409
,
"ATLAS-409-00-002"
,
"Given type {0} has references"
),
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java
View file @
ee8c81df
...
...
@@ -79,14 +79,22 @@ public class AtlasRelationshipDefStoreV1 extends AtlasAbstractDefStoreV1 impleme
updateVertexPreCreate
(
relationshipDef
,
(
AtlasRelationshipType
)
type
,
relationshipDefVertex
);
final
AtlasRelationshipEndDef
endDef1
=
relationshipDef
.
getEndDef1
();
final
String
type1
=
endDef1
.
getType
();
final
AtlasRelationshipEndDef
endDef2
=
relationshipDef
.
getEndDef2
();
final
String
type1
=
endDef1
.
getType
();
final
String
type2
=
endDef2
.
getType
();
final
String
name1
=
endDef1
.
getName
();
final
String
name2
=
endDef2
.
getName
();
AtlasVertex
end1TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type1
);
final
AtlasVertex
end1TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type1
);
final
AtlasVertex
end2TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type2
);
if
(
end1TypeVertex
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND
,
relationshipDef
.
getName
(),
type1
);
}
if
(
end2TypeVertex
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
RELATIONSHIPDEF_END_TYPE_NAME_NOT_FOUND
,
relationshipDef
.
getName
(),
type2
);
}
AtlasVertex
end2TypeVertex
=
typeDefStore
.
findTypeVertexByName
(
type2
);
// create an edge between the relationshipDef and each of the entityDef vertices.
AtlasEdge
edge1
=
typeDefStore
.
getOrCreateEdge
(
relationshipDefVertex
,
end1TypeVertex
,
AtlasGraphUtilsV1
.
RELATIONSHIPTYPE_EDGE_LABEL
);
...
...
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