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
36956bc0
Commit
36956bc0
authored
4 years ago
by
Nikhil Bonte
Committed by
Madhan Neethiraj
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3701: performance improvements in classification-dissociation
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
6b783702
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
29 deletions
+21
-29
EntityGraphMapper.java
...he/atlas/repository/store/graph/v2/EntityGraphMapper.java
+21
-29
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v2/EntityGraphMapper.java
View file @
36956bc0
...
...
@@ -2014,6 +2014,12 @@ public class EntityGraphMapper {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INSTANCE_GUID_NOT_FOUND
,
entityGuid
);
}
AtlasPerfTracer
perf
=
null
;
if
(
AtlasPerfTracer
.
isPerfTraceEnabled
(
PERF_LOG
))
{
perf
=
AtlasPerfTracer
.
getPerfTracer
(
PERF_LOG
,
"EntityGraphMapper.deleteClassification"
);
}
List
<
String
>
traitNames
=
getTraitNames
(
entityVertex
);
if
(
CollectionUtils
.
isEmpty
(
traitNames
))
{
...
...
@@ -2022,8 +2028,6 @@ public class EntityGraphMapper {
validateClassificationExists
(
traitNames
,
classificationName
);
Map
<
AtlasVertex
,
List
<
AtlasClassification
>>
removedClassifications
=
new
HashMap
<>();
AtlasVertex
classificationVertex
=
getClassificationVertex
(
entityVertex
,
classificationName
);
AtlasClassification
classification
=
entityRetriever
.
toAtlasClassification
(
classificationVertex
);
...
...
@@ -2032,36 +2036,23 @@ public class EntityGraphMapper {
}
// remove classification from propagated entities if propagation is turned on
if
(
isPropagationEnabled
(
classificationVertex
))
{
List
<
AtlasVertex
>
propagatedEntityVertices
=
deleteDelegate
.
getHandler
().
removeTagPropagation
(
classificationVertex
);
// add propagated entities and deleted classification details to removeClassifications map
if
(
CollectionUtils
.
isNotEmpty
(
propagatedEntityVertices
))
{
for
(
AtlasVertex
propagatedEntityVertex
:
propagatedEntityVertices
)
{
List
<
AtlasClassification
>
classifications
=
removedClassifications
.
get
(
propagatedEntityVertex
);
if
(
classifications
==
null
)
{
classifications
=
new
ArrayList
<>();
final
List
<
AtlasVertex
>
entityVertices
;
removedClassifications
.
put
(
propagatedEntityVertex
,
classifications
);
}
if
(
isPropagationEnabled
(
classificationVertex
))
{
entityVertices
=
deleteDelegate
.
getHandler
().
removeTagPropagation
(
classificationVertex
);
classifications
.
add
(
classification
);
}
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Number of propagations to delete -> {}"
,
entityVertices
.
size
());
}
}
else
{
entityVertices
=
new
ArrayList
<>();
}
// add associated entity and deleted classification details to removeClassifications map
List
<
AtlasClassification
>
classifications
=
removedClassifications
.
get
(
entityVertex
);
if
(
classifications
==
null
)
{
classifications
=
new
ArrayList
<>();
removedClassifications
.
put
(
entityVertex
,
classifications
);
// add associated entity to entityVertices list
if
(!
entityVertices
.
contains
(
entityVertex
))
{
entityVertices
.
add
(
entityVertex
);
}
classifications
.
add
(
classification
);
// remove classifications from associated entity
if
(
LOG
.
isDebugEnabled
())
{
LOG
.
debug
(
"Removing classification: [{}] from: [{}][{}] with edge label: [{}]"
,
classificationName
,
...
...
@@ -2078,12 +2069,13 @@ public class EntityGraphMapper {
updateModificationMetadata
(
entityVertex
);
for
(
Map
.
Entry
<
AtlasVertex
,
List
<
AtlasClassification
>>
entry
:
removedClassifications
.
entrySet
(
))
{
AtlasEntity
entity
=
updateClassificationText
(
entry
.
getKey
()
);
if
(
CollectionUtils
.
isNotEmpty
(
entityVertices
))
{
List
<
AtlasEntity
>
propagatedEntities
=
updateClassificationText
(
classification
,
entityVertices
);
List
<
AtlasClassification
>
deletedClassificationNames
=
entry
.
getValue
();
entityChangeNotifier
.
onClassification
DeletedFromEntity
(
entity
,
deletedClassificationNames
);
//Sending audit request for all entities at once
entityChangeNotifier
.
onClassification
sDeletedFromEntities
(
propagatedEntities
,
Collections
.
singletonList
(
classification
)
);
}
AtlasPerfTracer
.
log
(
perf
);
}
private
AtlasEntity
updateClassificationText
(
AtlasVertex
vertex
)
throws
AtlasBaseException
{
...
...
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