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
de916084
Commit
de916084
authored
7 years ago
by
nixonrodrigues
Committed by
Madhan Neethiraj
7 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1940: fix to remove duplicate type which causes Atlas server to fail during startup
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
c3808cf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
AtlasTypeDefGraphStore.java
.../atlas/repository/store/graph/AtlasTypeDefGraphStore.java
+17
-0
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/AtlasTypeDefGraphStore.java
View file @
de916084
...
...
@@ -159,6 +159,7 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
return
ret
;
}
@Override
public
AtlasRelationshipDef
getRelationshipDefByName
(
String
name
)
throws
AtlasBaseException
{
AtlasRelationshipDef
ret
=
typeRegistry
.
getRelationshipDefByName
(
name
);
...
...
@@ -680,21 +681,37 @@ public abstract class AtlasTypeDefGraphStore implements AtlasTypeDefStore, Activ
for
(
AtlasStructDef
structDef
:
typesDef
.
getStructDefs
())
{
rectifyAttributesIfNeeded
(
entityNames
,
structDef
);
}
removeDuplicateTypeIfAny
(
typesDef
.
getStructDefs
());
}
if
(
CollectionUtils
.
isNotEmpty
(
typesDef
.
getClassificationDefs
()))
{
for
(
AtlasClassificationDef
classificationDef
:
typesDef
.
getClassificationDefs
())
{
rectifyAttributesIfNeeded
(
entityNames
,
classificationDef
);
}
removeDuplicateTypeIfAny
(
typesDef
.
getClassificationDefs
());
}
if
(
CollectionUtils
.
isNotEmpty
(
typesDef
.
getEntityDefs
()))
{
for
(
AtlasEntityDef
entityDef
:
typesDef
.
getEntityDefs
())
{
rectifyAttributesIfNeeded
(
entityNames
,
entityDef
);
}
removeDuplicateTypeIfAny
(
typesDef
.
getEntityDefs
());
}
}
private
<
T
extends
AtlasBaseTypeDef
>
void
removeDuplicateTypeIfAny
(
List
<
T
>
defList
)
{
final
Set
<
String
>
entityDefNames
=
new
HashSet
<>();
for
(
int
i
=
0
;
i
<
defList
.
size
();
i
++)
{
if
(!
entityDefNames
.
add
((
defList
.
get
(
i
)).
getName
()))
{
LOG
.
warn
(
" Found Duplicate Type => "
+
defList
.
get
(
i
).
getName
());
defList
.
remove
(
i
);
i
--;
}
}
}
private
void
rectifyAttributesIfNeeded
(
final
Set
<
String
>
entityNames
,
AtlasStructDef
structDef
)
{
List
<
AtlasAttributeDef
>
attributeDefs
=
structDef
.
getAttributeDefs
();
...
...
This diff is collapsed.
Click to expand it.
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