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
1e75da0d
Commit
1e75da0d
authored
Nov 20, 2017
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2283: add subTypes field in AtlasClassificationDef and AtlasEntityDef
parent
12622e02
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
122 additions
and
31 deletions
+122
-31
AtlasClassificationDef.java
...rg/apache/atlas/model/typedef/AtlasClassificationDef.java
+12
-0
AtlasEntityDef.java
...n/java/org/apache/atlas/model/typedef/AtlasEntityDef.java
+12
-0
AtlasClassificationType.java
...n/java/org/apache/atlas/type/AtlasClassificationType.java
+16
-1
AtlasEntityType.java
.../src/main/java/org/apache/atlas/type/AtlasEntityType.java
+18
-3
TestAtlasTypeRegistry.java
...est/java/org/apache/atlas/type/TestAtlasTypeRegistry.java
+64
-27
No files found.
intg/src/main/java/org/apache/atlas/model/typedef/AtlasClassificationDef.java
View file @
1e75da0d
...
...
@@ -55,6 +55,10 @@ public class AtlasClassificationDef extends AtlasStructDef implements java.io.Se
private
Set
<
String
>
superTypes
;
private
Set
<
String
>
entityTypes
;
// subTypes field below is derived from 'superTypes' specified in all AtlasClassificationDef
// this value is ignored during create & update operations
private
Set
<
String
>
subTypes
;
public
AtlasClassificationDef
()
{
this
(
null
,
null
,
null
,
null
,
null
,
null
);
...
...
@@ -119,6 +123,14 @@ public class AtlasClassificationDef extends AtlasStructDef implements java.io.Se
}
}
public
Set
<
String
>
getSubTypes
()
{
return
subTypes
;
}
public
void
setSubTypes
(
Set
<
String
>
subTypes
)
{
this
.
subTypes
=
subTypes
;
}
public
boolean
hasSuperType
(
String
typeName
)
{
return
hasSuperType
(
superTypes
,
typeName
);
}
...
...
intg/src/main/java/org/apache/atlas/model/typedef/AtlasEntityDef.java
View file @
1e75da0d
...
...
@@ -54,6 +54,10 @@ public class AtlasEntityDef extends AtlasStructDef implements java.io.Serializab
private
Set
<
String
>
superTypes
;
// subTypes field below is derived from 'superTypes' specified in all AtlasEntityDef
// this value is ignored during create & update operations
private
Set
<
String
>
subTypes
;
public
AtlasEntityDef
()
{
this
(
null
,
null
,
null
,
null
,
null
,
null
);
...
...
@@ -109,6 +113,14 @@ public class AtlasEntityDef extends AtlasStructDef implements java.io.Serializab
}
}
public
Set
<
String
>
getSubTypes
()
{
return
subTypes
;
}
public
void
setSubTypes
(
Set
<
String
>
subTypes
)
{
this
.
subTypes
=
subTypes
;
}
public
boolean
hasSuperType
(
String
typeName
)
{
return
hasSuperType
(
superTypes
,
typeName
);
}
...
...
intg/src/main/java/org/apache/atlas/type/AtlasClassificationType.java
View file @
1e75da0d
...
...
@@ -41,6 +41,7 @@ public class AtlasClassificationType extends AtlasStructType {
private
List
<
AtlasClassificationType
>
superTypes
=
Collections
.
emptyList
();
private
Set
<
String
>
allSuperTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
subTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
allSubTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
typeAndAllSubTypes
=
Collections
.
emptySet
();
private
String
typeAndAllSubTypesQryStr
=
""
;
...
...
@@ -103,6 +104,7 @@ public class AtlasClassificationType extends AtlasStructType {
this
.
allSuperTypes
=
Collections
.
unmodifiableSet
(
allS
);
this
.
allAttributes
=
Collections
.
unmodifiableMap
(
allA
);
this
.
uniqAttributes
=
getUniqueAttributes
(
this
.
allAttributes
);
this
.
subTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
allSubTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
typeAndAllSubTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
entityTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase3()
...
...
@@ -114,9 +116,13 @@ public class AtlasClassificationType extends AtlasStructType {
void
resolveReferencesPhase2
(
AtlasTypeRegistry
typeRegistry
)
throws
AtlasBaseException
{
super
.
resolveReferencesPhase2
(
typeRegistry
);
for
(
AtlasClassificationType
superType
:
superTypes
)
{
superType
.
addSubType
(
this
);
}
for
(
String
superTypeName
:
allSuperTypes
)
{
AtlasClassificationType
superType
=
typeRegistry
.
getClassificationTypeByName
(
superTypeName
);
superType
.
add
SubType
(
this
);
superType
.
add
ToAllSubTypes
(
this
);
}
}
...
...
@@ -139,6 +145,7 @@ public class AtlasClassificationType extends AtlasStructType {
*/
@Override
void
resolveReferencesPhase3
(
AtlasTypeRegistry
typeRegistry
)
throws
AtlasBaseException
{
subTypes
=
Collections
.
unmodifiableSet
(
subTypes
);
allSubTypes
=
Collections
.
unmodifiableSet
(
allSubTypes
);
typeAndAllSubTypes
=
Collections
.
unmodifiableSet
(
typeAndAllSubTypes
);
typeAndAllSubTypesQryStr
=
""
;
// will be computed on next access
...
...
@@ -206,9 +213,15 @@ public class AtlasClassificationType extends AtlasStructType {
}
}
}
classificationDef
.
setSubTypes
(
subTypes
);
}
private
void
addSubType
(
AtlasClassificationType
subType
)
{
subTypes
.
add
(
subType
.
getTypeName
());
}
private
void
addToAllSubTypes
(
AtlasClassificationType
subType
)
{
allSubTypes
.
add
(
subType
.
getTypeName
());
typeAndAllSubTypes
.
add
(
subType
.
getTypeName
());
}
...
...
@@ -219,6 +232,8 @@ public class AtlasClassificationType extends AtlasStructType {
public
Set
<
String
>
getAllSuperTypes
()
{
return
allSuperTypes
;
}
public
Set
<
String
>
getSubTypes
()
{
return
subTypes
;
}
public
Set
<
String
>
getAllSubTypes
()
{
return
allSubTypes
;
}
public
Set
<
String
>
getTypeAndAllSubTypes
()
{
return
typeAndAllSubTypes
;
}
...
...
intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java
View file @
1e75da0d
...
...
@@ -51,6 +51,7 @@ public class AtlasEntityType extends AtlasStructType {
private
List
<
AtlasEntityType
>
superTypes
=
Collections
.
emptyList
();
private
Set
<
String
>
allSuperTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
subTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
allSubTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
typeAndAllSubTypes
=
Collections
.
emptySet
();
private
Set
<
String
>
typeAndAllSuperTypes
=
Collections
.
emptySet
();
...
...
@@ -58,6 +59,7 @@ public class AtlasEntityType extends AtlasStructType {
private
Map
<
String
,
List
<
AtlasRelationshipType
>>
relationshipAttributesType
=
Collections
.
emptyMap
();
private
String
typeAndAllSubTypesQryStr
=
""
;
public
AtlasEntityType
(
AtlasEntityDef
entityDef
)
{
super
(
entityDef
);
...
...
@@ -98,6 +100,7 @@ public class AtlasEntityType extends AtlasStructType {
this
.
allSuperTypes
=
Collections
.
unmodifiableSet
(
allS
);
this
.
allAttributes
=
Collections
.
unmodifiableMap
(
allA
);
this
.
uniqAttributes
=
getUniqueAttributes
(
this
.
allAttributes
);
this
.
subTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
allSubTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
typeAndAllSubTypes
=
new
HashSet
<>();
// this will be populated in resolveReferencesPhase2()
this
.
relationshipAttributes
=
new
HashMap
<>();
// this will be populated in resolveReferencesPhase3()
...
...
@@ -114,9 +117,13 @@ public class AtlasEntityType extends AtlasStructType {
void
resolveReferencesPhase2
(
AtlasTypeRegistry
typeRegistry
)
throws
AtlasBaseException
{
super
.
resolveReferencesPhase2
(
typeRegistry
);
for
(
AtlasEntityType
superType
:
superTypes
)
{
superType
.
addSubType
(
this
);
}
for
(
String
superTypeName
:
allSuperTypes
)
{
AtlasEntityType
superType
=
typeRegistry
.
getEntityTypeByName
(
superTypeName
);
superType
.
add
SubType
(
this
);
superType
.
add
ToAllSubTypes
(
this
);
}
}
...
...
@@ -150,11 +157,14 @@ public class AtlasEntityType extends AtlasStructType {
}
}
subTypes
=
Collections
.
unmodifiableSet
(
subTypes
);
allSubTypes
=
Collections
.
unmodifiableSet
(
allSubTypes
);
typeAndAllSubTypes
=
Collections
.
unmodifiableSet
(
typeAndAllSubTypes
);
typeAndAllSubTypesQryStr
=
""
;
// will be computed on next access
relationshipAttributes
=
Collections
.
unmodifiableMap
(
relationshipAttributes
);
relationshipAttributesType
=
Collections
.
unmodifiableMap
(
relationshipAttributesType
);
entityDef
.
setSubTypes
(
subTypes
);
}
public
Set
<
String
>
getSuperTypes
()
{
...
...
@@ -165,6 +175,8 @@ public class AtlasEntityType extends AtlasStructType {
return
allSuperTypes
;
}
public
Set
<
String
>
getSubTypes
()
{
return
subTypes
;
}
public
Set
<
String
>
getAllSubTypes
()
{
return
allSubTypes
;
}
public
Set
<
String
>
getTypeAndAllSubTypes
()
{
return
typeAndAllSubTypes
;
}
...
...
@@ -435,6 +447,10 @@ public class AtlasEntityType extends AtlasStructType {
}
private
void
addSubType
(
AtlasEntityType
subType
)
{
subTypes
.
add
(
subType
.
getTypeName
());
}
private
void
addToAllSubTypes
(
AtlasEntityType
subType
)
{
allSubTypes
.
add
(
subType
.
getTypeName
());
typeAndAllSubTypes
.
add
(
subType
.
getTypeName
());
}
...
...
@@ -679,4 +695,4 @@ public class AtlasEntityType extends AtlasStructType {
return
ret
;
}
}
\ No newline at end of file
}
intg/src/test/java/org/apache/atlas/type/TestAtlasTypeRegistry.java
View file @
1e75da0d
...
...
@@ -101,15 +101,15 @@ public class TestAtlasTypeRegistry {
assertNull
(
failureMsg
);
validateSuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validateSuperTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
,
"L1-2"
)));
validateSuperTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-2"
,
"L0"
)));
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
,
"L2-1"
,
"L2-2"
,
"L2-3"
,
"L2-4"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validate
All
SuperTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
,
"L1-2"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-2"
,
"L0"
)));
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
)));
validateSubTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-1"
,
"L2-2"
,
"L2-3"
)));
validateSubTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-3"
,
"L2-4"
)));
validateSubTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<
String
>());
...
...
@@ -117,6 +117,14 @@ public class TestAtlasTypeRegistry {
validateSubTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<
String
>());
validateSubTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
,
"L2-1"
,
"L2-2"
,
"L2-3"
,
"L2-4"
)));
validateAllSubTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-1"
,
"L2-2"
,
"L2-3"
)));
validateAllSubTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-3"
,
"L2-4"
)));
validateAllSubTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<
String
>());
validateAttributeNames
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
)));
validateAttributeNames
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
,
"L1-1_a1"
)));
validateAttributeNames
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
,
"L1-2_a1"
)));
...
...
@@ -273,15 +281,15 @@ public class TestAtlasTypeRegistry {
}
assertNull
(
failureMsg
);
validateSuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validateSuperTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validateSuperTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
,
"L1-2"
)));
validateSuperTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-2"
,
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validate
All
SuperTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L0"
,
"L1-2"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-2"
,
"L0"
)));
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
,
"L2-1"
,
"L2-2"
,
"L2-3"
,
"L2-4"
)));
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
)));
validateSubTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-1"
,
"L2-2"
,
"L2-3"
)));
validateSubTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-3"
,
"L2-4"
)));
validateSubTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<
String
>());
...
...
@@ -289,6 +297,14 @@ public class TestAtlasTypeRegistry {
validateSubTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<
String
>());
validateSubTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1-1"
,
"L1-2"
,
"L2-1"
,
"L2-2"
,
"L2-3"
,
"L2-4"
)));
validateAllSubTypes
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-1"
,
"L2-2"
,
"L2-3"
)));
validateAllSubTypes
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L2-3"
,
"L2-4"
)));
validateAllSubTypes
(
typeRegistry
,
"L2-1"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-2"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-3"
,
new
HashSet
<
String
>());
validateAllSubTypes
(
typeRegistry
,
"L2-4"
,
new
HashSet
<
String
>());
validateAttributeNames
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
)));
validateAttributeNames
(
typeRegistry
,
"L1-1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
,
"L1-1_a1"
)));
validateAttributeNames
(
typeRegistry
,
"L1-2"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0_a1"
,
"L1-2_a1"
)));
...
...
@@ -519,11 +535,11 @@ public class TestAtlasTypeRegistry {
}
assertNull
(
failureMsg
);
validateSuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validate
All
SubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1"
)));
validateSuperTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSubTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<
String
>());
validate
All
SuperTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SubTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<
String
>());
// create a circular reference
...
...
@@ -552,11 +568,11 @@ public class TestAtlasTypeRegistry {
assertNull
(
typeRegistry
.
getEntityTypeByName
(
"L2"
));
validateSuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validateSubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1"
)));
validate
All
SuperTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<
String
>());
validate
All
SubTypes
(
typeRegistry
,
"L0"
,
new
HashSet
<>(
Arrays
.
asList
(
"L1"
)));
validateSuperTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validateSubTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<
String
>());
validate
All
SuperTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<>(
Arrays
.
asList
(
"L0"
)));
validate
All
SubTypes
(
typeRegistry
,
"L1"
,
new
HashSet
<
String
>());
}
private
boolean
addType
(
AtlasTypeRegistry
typeRegistry
,
AtlasBaseTypeDef
typeDef
)
{
...
...
@@ -578,7 +594,7 @@ public class TestAtlasTypeRegistry {
return
ret
;
}
private
void
validateSuperTypes
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
expectedSuperTypes
)
{
private
void
validate
All
SuperTypes
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
expectedSuperTypes
)
{
AtlasType
type
=
null
;
try
{
...
...
@@ -599,7 +615,7 @@ public class TestAtlasTypeRegistry {
assertEquals
(
superTypes
,
expectedSuperTypes
);
}
private
void
validateSubTypes
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
expectedSubTypes
)
{
private
void
validate
All
SubTypes
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
expectedSubTypes
)
{
AtlasType
type
=
null
;
try
{
...
...
@@ -620,6 +636,27 @@ public class TestAtlasTypeRegistry {
assertEquals
(
subTypes
,
expectedSubTypes
);
}
private
void
validateSubTypes
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
expectedSubTypes
)
{
AtlasType
type
=
null
;
try
{
type
=
typeRegistry
.
getType
(
typeName
);
}
catch
(
AtlasBaseException
excp
)
{
}
Set
<
String
>
subTypes
=
null
;
if
(
type
!=
null
)
{
if
(
type
instanceof
AtlasEntityType
)
{
subTypes
=
((
AtlasEntityType
)
type
).
getSubTypes
();
}
else
if
(
type
instanceof
AtlasClassificationType
)
{
subTypes
=
((
AtlasClassificationType
)
type
).
getSubTypes
();
}
}
assertEquals
(
subTypes
,
expectedSubTypes
);
}
private
void
validateAttributeNames
(
AtlasTypeRegistry
typeRegistry
,
String
typeName
,
Set
<
String
>
attributeNames
)
{
AtlasType
type
=
null
;
...
...
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