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
ca22400e
Commit
ca22400e
authored
Mar 08, 2019
by
Sridhar Swamy
Committed by
Madhan Neethiraj
Mar 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3069: avoid repeated warnings of missing relationship-def
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
3ed1f5a0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
AtlasEntityType.java
.../src/main/java/org/apache/atlas/type/AtlasEntityType.java
+1
-2
AtlasTypeRegistry.java
...rc/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
+13
-0
No files found.
intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java
View file @
ca22400e
...
...
@@ -182,8 +182,7 @@ public class AtlasEntityType extends AtlasStructType {
// validate if RelationshipDefs is defined for all entityDefs
if
(
attributeEntityType
!=
null
&&
!
hasRelationshipAttribute
(
attributeName
))
{
LOG
.
warn
(
"No RelationshipDef defined between {} and {} on attribute: {}.{}"
,
getTypeName
(),
attributeEntityType
.
getTypeName
(),
getTypeName
(),
attributeName
);
typeRegistry
.
reportMissingRelationshipDef
(
getTypeName
(),
attributeEntityType
.
getTypeName
(),
attributeName
);
}
}
...
...
intg/src/main/java/org/apache/atlas/type/AtlasTypeRegistry.java
View file @
ca22400e
...
...
@@ -56,16 +56,20 @@ public class AtlasTypeRegistry {
protected
RegistryData
registryData
;
private
final
TypeRegistryUpdateSynchronizer
updateSynchronizer
;
private
final
Set
<
String
>
missingRelationshipDefs
;
public
AtlasTypeRegistry
()
{
registryData
=
new
RegistryData
();
updateSynchronizer
=
new
TypeRegistryUpdateSynchronizer
(
this
);
missingRelationshipDefs
=
new
HashSet
<>();
}
// used only by AtlasTransientTypeRegistry
protected
AtlasTypeRegistry
(
AtlasTypeRegistry
other
)
{
registryData
=
new
RegistryData
();
updateSynchronizer
=
other
.
updateSynchronizer
;
missingRelationshipDefs
=
other
.
missingRelationshipDefs
;
}
public
Collection
<
String
>
getAllTypeNames
()
{
return
registryData
.
allTypes
.
getAllTypeNames
();
}
...
...
@@ -224,6 +228,15 @@ public class AtlasTypeRegistry {
updateSynchronizer
.
releaseTypeRegistryForUpdate
(
transientTypeRegistry
,
commitUpdates
);
}
public
void
reportMissingRelationshipDef
(
String
entityType1
,
String
entityType2
,
String
attributeName
)
{
String
key
=
entityType1
+
"->"
+
entityType2
+
":"
+
attributeName
;
if
(!
missingRelationshipDefs
.
contains
(
key
))
{
LOG
.
warn
(
"No RelationshipDef defined between {} and {} on attribute: {}.{}"
,
entityType1
,
entityType2
,
entityType1
,
attributeName
);
missingRelationshipDefs
.
add
(
key
);
}
}
static
class
RegistryData
{
final
TypeCache
allTypes
;
...
...
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