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
c3453f60
Commit
c3453f60
authored
Sep 22, 2015
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-147 Fix a code issue when defineTypes (ltfxyz via shwethags)
parent
1bfda02a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
7 deletions
+42
-7
release-log.txt
release-log.txt
+4
-6
TypeSystem.java
...in/java/org/apache/atlas/typesystem/types/TypeSystem.java
+1
-1
TypeSystemTest.java
...ava/org/apache/atlas/typesystem/types/TypeSystemTest.java
+37
-0
No files found.
release-log.txt
View file @
c3453f60
...
...
@@ -9,14 +9,12 @@ ATLAS-54 Rename configs in hive hook (shwethags)
ATLAS-3 Mixed Index creation fails with Date types (suma.shivaprasad via shwethags)
ALL CHANGES:
ATLAS-147 Fix a code issue when defineTypes (ltfxyz via shwethags)
ATLAS-110 UI: Lineage should be clickable (Vishal Kadam via Venkatesh Seetharam)
ATLAS-112 UI: Make lineage graph extensible for multiple nodes (Vishal Kadam
via Venkatesh Seetharam)
ATLAS-152 TimeStamp fields not showing the details tab (Vishal Kadam
via Venkatesh Seetharam)
ATLAS-112 UI: Make lineage graph extensible for multiple nodes (Vishal Kadam via Venkatesh Seetharam)
ATLAS-152 TimeStamp fields not showing the details tab (Vishal Kadam via Venkatesh Seetharam)
ATLAS-111 UI: Create Help Link (Vishal Kadam via Venkatesh Seetharam)
ATLAS-113 Add an About Dialog to Apache Atlas UI with version number (Vishal Kadam
via Venkatesh Seetharam)
ATLAS-113 Add an About Dialog to Apache Atlas UI with version number (Vishal Kadam via Venkatesh Seetharam)
ATLAS-109 Remove v2 Folder (Vishal Kadam via Venkatesh Seetharam)
ATLAS-90 Support offline builds (Vishal Kadam via Venkatesh Seetharam)
ATLAS-154 Update website for 0.5-incubating release (Venkatesh Seetharam)
...
...
typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java
View file @
c3453f60
...
...
@@ -516,7 +516,7 @@ public class TypeSystem {
for
(
StructTypeDefinition
structDef
:
structDefs
)
{
constructStructureType
(
structDef
);
typeCategoriesToTypeNamesMap
.
put
(
DataTypes
.
TypeCategory
.
CLASS
,
structDef
.
typeName
);
typeCategoriesToTypeNamesMap
.
put
(
DataTypes
.
TypeCategory
.
STRUCT
,
structDef
.
typeName
);
}
for
(
TraitType
traitType
:
traitTypes
)
{
...
...
typesystem/src/test/java/org/apache/atlas/typesystem/types/TypeSystemTest.java
View file @
c3453f60
...
...
@@ -139,4 +139,41 @@ public class TypeSystemTest extends BaseTest {
Assert
.
assertTrue
(
bc
.
compareTo
(
cc
)
<
0
);
Assert
.
assertTrue
(
ac
.
compareTo
(
cc
)
<
0
);
}
@Test
public
void
testTypeCategory
()
throws
AtlasException
{
TypeSystem
ts
=
getTypeSystem
();
ts
.
reset
();
StructTypeDefinition
struct_A
=
createStructTypeDef
(
"struct_A"
,
createRequiredAttrDef
(
"s_A"
,
DataTypes
.
STRING_TYPE
));
StructTypeDefinition
struct_B
=
createStructTypeDef
(
"struct_B"
,
createRequiredAttrDef
(
"s_B"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
TraitType
>
trait_A
=
createTraitTypeDef
(
"trait_A"
,
null
,
createRequiredAttrDef
(
"t_A"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
TraitType
>
trait_B
=
createTraitTypeDef
(
"trait_B"
,
ImmutableList
.<
String
>
of
(
"trait_A"
),
createRequiredAttrDef
(
"t_B"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
TraitType
>
trait_C
=
createTraitTypeDef
(
"trait_C"
,
ImmutableList
.<
String
>
of
(
"trait_A"
),
createRequiredAttrDef
(
"t_C"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
TraitType
>
trait_D
=
createTraitTypeDef
(
"trait_D"
,
ImmutableList
.<
String
>
of
(
"trait_B"
,
"trait_C"
),
createRequiredAttrDef
(
"t_D"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
ClassType
>
class_A
=
createClassTypeDef
(
"class_A"
,
null
,
createRequiredAttrDef
(
"c_A"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
ClassType
>
class_B
=
createClassTypeDef
(
"class_B"
,
ImmutableList
.<
String
>
of
(
"class_A"
),
createRequiredAttrDef
(
"c_B"
,
DataTypes
.
STRING_TYPE
));
HierarchicalTypeDefinition
<
ClassType
>
class_C
=
createClassTypeDef
(
"class_C"
,
ImmutableList
.<
String
>
of
(
"class_B"
),
createRequiredAttrDef
(
"c_C"
,
DataTypes
.
STRING_TYPE
));
ts
.
defineTypes
(
ImmutableList
.<
EnumTypeDefinition
>
of
(),
ImmutableList
.
of
(
struct_A
,
struct_B
),
ImmutableList
.
of
(
trait_A
,
trait_B
,
trait_C
,
trait_D
),
ImmutableList
.
of
(
class_A
,
class_B
,
class_C
));
final
ImmutableList
<
String
>
structNames
=
ts
.
getTypeNamesByCategory
(
DataTypes
.
TypeCategory
.
STRUCT
);
final
ImmutableList
<
String
>
traitNames
=
ts
.
getTypeNamesByCategory
(
DataTypes
.
TypeCategory
.
TRAIT
);
final
ImmutableList
<
String
>
classNames
=
ts
.
getTypeNamesByCategory
(
DataTypes
.
TypeCategory
.
CLASS
);
Assert
.
assertEquals
(
structNames
.
size
(),
2
);
Assert
.
assertEquals
(
traitNames
.
size
(),
4
);
Assert
.
assertEquals
(
classNames
.
size
(),
3
);
}
}
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