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
13ba156f
Commit
13ba156f
authored
Jul 20, 2017
by
Sarath Subramanian
Committed by
Madhan Neethiraj
Jul 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1979: Update storm model relationship category and fix for UT and Coverity scan issues
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
e0fb7dc1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
0080-storm_model.json
addons/models/0080-storm_model.json
+1
-1
EntityGraphMapper.java
...he/atlas/repository/store/graph/v1/EntityGraphMapper.java
+7
-2
ReverseReferenceUpdateSoftDeleteTest.java
...epository/graph/ReverseReferenceUpdateSoftDeleteTest.java
+1
-0
AtlasRelationshipStoreV1Test.java
...pository/store/graph/v1/AtlasRelationshipStoreV1Test.java
+7
-3
No files found.
addons/models/0080-storm_model.json
View file @
13ba156f
...
@@ -147,7 +147,7 @@
...
@@ -147,7 +147,7 @@
{
{
"name"
:
"storm_topology_nodes"
,
"name"
:
"storm_topology_nodes"
,
"typeVersion"
:
"1.0"
,
"typeVersion"
:
"1.0"
,
"relationshipCategory"
:
"A
SSOCI
ATION"
,
"relationshipCategory"
:
"A
GGREG
ATION"
,
"endDef1"
:
{
"endDef1"
:
{
"type"
:
"storm_topology"
,
"type"
:
"storm_topology"
,
"name"
:
"nodes"
,
"name"
:
"nodes"
,
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java
View file @
13ba156f
...
@@ -1075,7 +1075,7 @@ public class EntityGraphMapper {
...
@@ -1075,7 +1075,7 @@ public class EntityGraphMapper {
String
newEntityId
=
getIdFromVertex
(
newEntityVertex
);
String
newEntityId
=
getIdFromVertex
(
newEntityVertex
);
AtlasEdge
ret
=
currentEdge
;
AtlasEdge
ret
=
currentEdge
;
if
(!
currentEntityId
.
equals
(
newEntityId
)
&&
newEntityVertex
!=
null
)
{
if
(!
currentEntityId
.
equals
(
newEntityId
))
{
// create a new relationship edge to the new attribute vertex from the instance
// create a new relationship edge to the new attribute vertex from the instance
String
relationshipName
=
AtlasGraphUtilsV1
.
getTypeName
(
currentEdge
);
String
relationshipName
=
AtlasGraphUtilsV1
.
getTypeName
(
currentEdge
);
...
@@ -1230,6 +1230,11 @@ public class EntityGraphMapper {
...
@@ -1230,6 +1230,11 @@ public class EntityGraphMapper {
// get the classification vertex from entity
// get the classification vertex from entity
String
relationshipLabel
=
GraphHelper
.
getTraitLabel
(
entityTypeName
,
classification
.
getTypeName
());
String
relationshipLabel
=
GraphHelper
.
getTraitLabel
(
entityTypeName
,
classification
.
getTypeName
());
AtlasEdge
classificationEdge
=
graphHelper
.
getEdgeForLabel
(
instanceVertex
,
relationshipLabel
);
AtlasEdge
classificationEdge
=
graphHelper
.
getEdgeForLabel
(
instanceVertex
,
relationshipLabel
);
if
(
classificationEdge
==
null
)
{
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INVALID_VALUE
,
"classificationEdge is null for label: "
+
relationshipLabel
);
}
AtlasVertex
classificationVertex
=
classificationEdge
.
getInVertex
();
AtlasVertex
classificationVertex
=
classificationEdge
.
getInVertex
();
if
(
LOG
.
isDebugEnabled
())
{
if
(
LOG
.
isDebugEnabled
())
{
...
@@ -1363,7 +1368,7 @@ public class EntityGraphMapper {
...
@@ -1363,7 +1368,7 @@ public class EntityGraphMapper {
private
boolean
objectIdsContain
(
Collection
<
AtlasObjectId
>
objectIds
,
AtlasObjectId
objectId
)
{
private
boolean
objectIdsContain
(
Collection
<
AtlasObjectId
>
objectIds
,
AtlasObjectId
objectId
)
{
boolean
ret
=
false
;
boolean
ret
=
false
;
if
(
objectIds
!=
null
&&
objectIds
.
isEmpty
(
))
{
if
(
CollectionUtils
.
isEmpty
(
objectIds
))
{
ret
=
false
;
ret
=
false
;
}
else
{
}
else
{
...
...
repository/src/test/java/org/apache/atlas/repository/graph/ReverseReferenceUpdateSoftDeleteTest.java
View file @
13ba156f
...
@@ -48,6 +48,7 @@ public class ReverseReferenceUpdateSoftDeleteTest extends ReverseReferenceUpdate
...
@@ -48,6 +48,7 @@ public class ReverseReferenceUpdateSoftDeleteTest extends ReverseReferenceUpdate
AtlasVertex
vertexForGUID
=
GraphHelper
.
getInstance
().
getVertexForGUID
(
referencingInstance
.
getId
().
_getId
());
AtlasVertex
vertexForGUID
=
GraphHelper
.
getInstance
().
getVertexForGUID
(
referencingInstance
.
getId
().
_getId
());
String
edgeLabel
=
GraphHelper
.
getEdgeLabel
(
typeB
,
typeB
.
fieldMapping
.
fields
.
get
(
"a"
));
String
edgeLabel
=
GraphHelper
.
getEdgeLabel
(
typeB
,
typeB
.
fieldMapping
.
fields
.
get
(
"a"
));
AtlasEdge
edgeForLabel
=
GraphHelper
.
getInstance
().
getEdgeForLabel
(
vertexForGUID
,
edgeLabel
);
AtlasEdge
edgeForLabel
=
GraphHelper
.
getInstance
().
getEdgeForLabel
(
vertexForGUID
,
edgeLabel
);
Assert
.
assertNotNull
(
edgeForLabel
);
String
edgeState
=
edgeForLabel
.
getProperty
(
Constants
.
STATE_PROPERTY_KEY
,
String
.
class
);
String
edgeState
=
edgeForLabel
.
getProperty
(
Constants
.
STATE_PROPERTY_KEY
,
String
.
class
);
Assert
.
assertEquals
(
edgeState
,
Id
.
EntityState
.
DELETED
.
name
());
Assert
.
assertEquals
(
edgeState
,
Id
.
EntityState
.
DELETED
.
name
());
}
}
...
...
repository/src/test/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipStoreV1Test.java
View file @
13ba156f
...
@@ -169,7 +169,7 @@ public abstract class AtlasRelationshipStoreV1Test {
...
@@ -169,7 +169,7 @@ public abstract class AtlasRelationshipStoreV1Test {
assertObjectIdEquals
(
johnMentorId
,
maxId
);
assertObjectIdEquals
(
johnMentorId
,
maxId
);
List
<
AtlasObjectId
>
johnMenteesId
=
toAtlasObjectIds
(
john
.
getRelationshipAttribute
(
"mentees"
));
List
<
AtlasObjectId
>
johnMenteesId
=
toAtlasObjectIds
(
john
.
getRelationshipAttribute
(
"mentees"
));
assert
Null
(
johnMenteesId
);
assert
Empty
(
johnMenteesId
);
// Jane Manager validation
// Jane Manager validation
AtlasObjectId
janeDepartmentId
=
toAtlasObjectId
(
jane
.
getRelationshipAttribute
(
"department"
));
AtlasObjectId
janeDepartmentId
=
toAtlasObjectId
(
jane
.
getRelationshipAttribute
(
"department"
));
...
@@ -183,7 +183,7 @@ public abstract class AtlasRelationshipStoreV1Test {
...
@@ -183,7 +183,7 @@ public abstract class AtlasRelationshipStoreV1Test {
assertNull
(
janeMentorId
);
assertNull
(
janeMentorId
);
List
<
AtlasObjectId
>
janeMenteesId
=
toAtlasObjectIds
(
jane
.
getRelationshipAttribute
(
"mentees"
));
List
<
AtlasObjectId
>
janeMenteesId
=
toAtlasObjectIds
(
jane
.
getRelationshipAttribute
(
"mentees"
));
assert
Null
(
janeMenteesId
);
assert
Empty
(
janeMenteesId
);
List
<
AtlasObjectId
>
janeSubordinateIds
=
toAtlasObjectIds
(
jane
.
getRelationshipAttribute
(
"subordinates"
));
List
<
AtlasObjectId
>
janeSubordinateIds
=
toAtlasObjectIds
(
jane
.
getRelationshipAttribute
(
"subordinates"
));
assertNotNull
(
janeSubordinateIds
);
assertNotNull
(
janeSubordinateIds
);
...
@@ -208,7 +208,7 @@ public abstract class AtlasRelationshipStoreV1Test {
...
@@ -208,7 +208,7 @@ public abstract class AtlasRelationshipStoreV1Test {
assertObjectIdsContains
(
juliusMenteesId
,
maxId
);
assertObjectIdsContains
(
juliusMenteesId
,
maxId
);
List
<
AtlasObjectId
>
juliusSubordinateIds
=
toAtlasObjectIds
(
julius
.
getRelationshipAttribute
(
"subordinates"
));
List
<
AtlasObjectId
>
juliusSubordinateIds
=
toAtlasObjectIds
(
julius
.
getRelationshipAttribute
(
"subordinates"
));
assert
Null
(
juliusSubordinateIds
);
assert
Empty
(
juliusSubordinateIds
);
}
}
@Test
@Test
...
@@ -444,6 +444,10 @@ public abstract class AtlasRelationshipStoreV1Test {
...
@@ -444,6 +444,10 @@ public abstract class AtlasRelationshipStoreV1Test {
assertTrue
(
objId1
.
equals
(
objId2
));
assertTrue
(
objId1
.
equals
(
objId2
));
}
}
private
static
void
assertEmpty
(
List
collection
)
{
assertTrue
(
collection
!=
null
&&
collection
.
isEmpty
());
}
private
static
List
<
AtlasObjectId
>
toAtlasObjectIds
(
Object
objectIds
)
{
private
static
List
<
AtlasObjectId
>
toAtlasObjectIds
(
Object
objectIds
)
{
if
(
objectIds
instanceof
List
)
{
if
(
objectIds
instanceof
List
)
{
return
(
List
<
AtlasObjectId
>)
objectIds
;
return
(
List
<
AtlasObjectId
>)
objectIds
;
...
...
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