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
50ff27c7
Commit
50ff27c7
authored
Mar 11, 2019
by
jajodia
Committed by
Madhan Neethiraj
Mar 12, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3041: fix for failure in deleting relationship-def by name
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
df44a5cb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
1 deletion
+63
-1
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+2
-0
AtlasTypeDefGraphStoreTest.java
...as/repository/store/graph/AtlasTypeDefGraphStoreTest.java
+6
-0
hiveDBv2.json
repository/src/test/resources/json/hiveDBv2.json
+55
-1
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
50ff27c7
...
...
@@ -619,6 +619,8 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore {
typesDef
.
setEntityDefs
(
Collections
.
singletonList
((
AtlasEntityDef
)
baseTypeDef
));
}
else
if
(
baseTypeDef
instanceof
AtlasEnumDef
)
{
typesDef
.
setEnumDefs
(
Collections
.
singletonList
((
AtlasEnumDef
)
baseTypeDef
));
}
else
if
(
baseTypeDef
instanceof
AtlasRelationshipDef
)
{
typesDef
.
setRelationshipDefs
(
Collections
.
singletonList
((
AtlasRelationshipDef
)
baseTypeDef
));
}
else
if
(
baseTypeDef
instanceof
AtlasStructDef
)
{
typesDef
.
setStructDefs
(
Collections
.
singletonList
((
AtlasStructDef
)
baseTypeDef
));
}
...
...
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStoreTest.java
View file @
50ff27c7
...
...
@@ -332,9 +332,15 @@ public class AtlasTypeDefGraphStoreTest {
try
{
final
String
HIVEDB_v2_JSON
=
"hiveDBv2"
;
final
String
hiveDB2
=
"hive_db_v2"
;
final
String
relationshipDefName
=
"cluster_hosts_relationship"
;
final
String
hostEntityDef
=
"host"
;
final
String
clusterEntityDef
=
"cluster"
;
AtlasTypesDef
typesDef
=
TestResourceFileUtils
.
readObjectFromJson
(
"."
,
HIVEDB_v2_JSON
,
AtlasTypesDef
.
class
);
typeDefStore
.
createTypesDef
(
typesDef
);
typeDefStore
.
deleteTypeByName
(
hiveDB2
);
typeDefStore
.
deleteTypeByName
(
relationshipDefName
);
typeDefStore
.
deleteTypeByName
(
hostEntityDef
);
typeDefStore
.
deleteTypeByName
(
clusterEntityDef
);
}
catch
(
AtlasBaseException
e
)
{
fail
(
"Deletion should've succeeded"
);
}
...
...
repository/src/test/resources/json/hiveDBv2.json
View file @
50ff27c7
...
...
@@ -52,5 +52,58 @@
"isUnique"
:
false
,
"isIndexable"
:
false
}]
}]
},
{
"name"
:
"cluster"
,
"serviceType"
:
"atlas_core"
,
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"attr1"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"isUnique"
:
false
}
]
},
{
"name"
:
"host"
,
"serviceType"
:
"atlas_core"
,
"typeVersion"
:
"1.0"
,
"attributeDefs"
:
[
{
"name"
:
"attr2"
,
"typeName"
:
"string"
,
"cardinality"
:
"SINGLE"
,
"isIndexable"
:
true
,
"isOptional"
:
false
,
"includeInNotification"
:
true
,
"isUnique"
:
false
}
]
}],
"relationshipDefs"
:
[
{
"name"
:
"cluster_hosts_relationship"
,
"relationshipLabel"
:
"cluster_hosts_relationship_label"
,
"serviceType"
:
"atlas_core"
,
"typeVersion"
:
"1.0"
,
"relationshipCategory"
:
"COMPOSITION"
,
"propagateTags"
:
"NONE"
,
"endDef1"
:
{
"type"
:
"cluster"
,
"name"
:
"host_list"
,
"isContainer"
:
true
,
"cardinality"
:
"SET"
},
"endDef2"
:
{
"type"
:
"host"
,
"name"
:
"cluster"
,
"isContainer"
:
false
,
"cardinality"
:
"SINGLE"
}
}
]
}
\ No newline at end of file
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