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
eb22be8c
Commit
eb22be8c
authored
6 years ago
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2770: entity-delete fails when Atlas is configured for hard-delete
parent
78cfd718
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
9 deletions
+24
-9
AtlasEntityChangeNotifier.java
.../repository/store/graph/v2/AtlasEntityChangeNotifier.java
+24
-9
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityChangeNotifier.java
View file @
eb22be8c
...
...
@@ -302,7 +302,7 @@ public class AtlasEntityChangeNotifier {
}
private
void
notifyV2Listeners
(
List
<
AtlasEntityHeader
>
entityHeaders
,
EntityOperation
operation
,
boolean
isImport
)
throws
AtlasBaseException
{
List
<
AtlasEntity
>
entities
=
toAtlasEntities
(
entityHeaders
);
List
<
AtlasEntity
>
entities
=
toAtlasEntities
(
entityHeaders
,
operation
);
for
(
EntityChangeListenerV2
listener
:
entityChangeListenersV2
)
{
switch
(
operation
)
{
...
...
@@ -377,27 +377,42 @@ public class AtlasEntityChangeNotifier {
return
ret
;
}
private
List
<
AtlasEntity
>
toAtlasEntities
(
List
<
AtlasEntityHeader
>
entityHeaders
)
throws
AtlasBaseException
{
private
List
<
AtlasEntity
>
toAtlasEntities
(
List
<
AtlasEntityHeader
>
entityHeaders
,
EntityOperation
operation
)
throws
AtlasBaseException
{
List
<
AtlasEntity
>
ret
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
entityHeaders
))
{
for
(
AtlasEntityHeader
entityHeader
:
entityHeaders
)
{
String
entityGuid
=
entityHeader
.
getGuid
();
String
typeName
=
entityHeader
.
getTypeName
();
String
entityGuid
=
entityHeader
.
getGuid
();
String
typeName
=
entityHeader
.
getTypeName
();
AtlasEntityType
entityType
=
atlasTypeRegistry
.
getEntityTypeByName
(
typeName
);
if
(
entityType
==
null
)
{
continue
;
}
// Skip all internal types as the HARD DELETE will cause lookup errors
AtlasEntityType
entityType
=
atlasTypeRegistry
.
getEntityTypeByName
(
typeName
);
if
(
Objects
.
nonNull
(
entityType
)
&&
entityType
.
isInternalType
())
{
if
(
entityType
.
isInternalType
())
{
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Skipping internal type = {}"
,
typeName
);
}
continue
;
}
AtlasEntityWithExtInfo
entityWithExtInfo
=
instanceConverter
.
getAndCacheEntity
(
entityGuid
);
final
AtlasEntity
entity
;
// delete notifications don't need all attributes. Hence the special handling for delete operation
if
(
operation
==
EntityOperation
.
DELETE
)
{
entity
=
new
AtlasEntity
(
typeName
,
entityHeader
.
getAttributes
());
entity
.
setGuid
(
entityGuid
);
}
else
{
AtlasEntityWithExtInfo
entityWithExtInfo
=
instanceConverter
.
getAndCacheEntity
(
entityGuid
);
entity
=
(
entityWithExtInfo
!=
null
)
?
entityWithExtInfo
.
getEntity
()
:
null
;
}
if
(
entity
WithExtInfo
!=
null
)
{
ret
.
add
(
entity
WithExtInfo
.
getEntity
()
);
if
(
entity
!=
null
)
{
ret
.
add
(
entity
);
}
}
}
...
...
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