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
45d3872b
Commit
45d3872b
authored
7 years ago
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2513: Notifications are not sent about impacted entities when…
ATLAS-2513: Notifications are not sent about impacted entities when classification is updated at source entity
parent
59673d48
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
11 deletions
+33
-11
EntityGraphMapper.java
...he/atlas/repository/store/graph/v1/EntityGraphMapper.java
+29
-8
EntityGraphRetriever.java
...atlas/repository/store/graph/v1/EntityGraphRetriever.java
+4
-3
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java
View file @
45d3872b
...
...
@@ -22,6 +22,7 @@ import org.apache.atlas.AtlasErrorCode;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.RequestContextV1
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.TimeBoundary
;
import
org.apache.atlas.model.TypeCategory
;
import
org.apache.atlas.model.instance.AtlasClassification
;
import
org.apache.atlas.model.instance.AtlasEntity
;
...
...
@@ -1479,10 +1480,11 @@ public class EntityGraphMapper {
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INSTANCE_GUID_NOT_FOUND
,
guid
);
}
String
entityTypeName
=
AtlasGraphUtilsV1
.
getTypeName
(
entityVertex
);
AtlasEntityType
entityType
=
typeRegistry
.
getEntityTypeByName
(
entityTypeName
);
List
<
AtlasClassification
>
updatedClassifications
=
new
ArrayList
<>();
List
<
AtlasVertex
>
entitiesToPropagateTo
=
new
ArrayList
<>();
String
entityTypeName
=
AtlasGraphUtilsV1
.
getTypeName
(
entityVertex
);
AtlasEntityType
entityType
=
typeRegistry
.
getEntityTypeByName
(
entityTypeName
);
List
<
AtlasClassification
>
updatedClassifications
=
new
ArrayList
<>();
List
<
AtlasVertex
>
entitiesToPropagateTo
=
new
ArrayList
<>();
Map
<
AtlasVertex
,
List
<
AtlasClassification
>>
addedPropagations
=
null
;
Map
<
AtlasVertex
,
List
<
String
>>
removedPropagations
=
null
;
...
...
@@ -1508,12 +1510,31 @@ public class EntityGraphMapper {
validateAndNormalizeForUpdate
(
classification
);
Map
<
String
,
Object
>
classificationAttributes
=
classification
.
getAttributes
();
boolean
isClassificationUpdated
=
false
;
// check for attribute update
Map
<
String
,
Object
>
updatedAttributes
=
classification
.
getAttributes
();
if
(
MapUtils
.
isNotEmpty
(
classification
Attributes
))
{
for
(
String
attributeName
:
classification
Attributes
.
keySet
())
{
currentClassification
.
setAttribute
(
attributeName
,
classification
Attributes
.
get
(
attributeName
));
if
(
MapUtils
.
isNotEmpty
(
updated
Attributes
))
{
for
(
String
attributeName
:
updated
Attributes
.
keySet
())
{
currentClassification
.
setAttribute
(
attributeName
,
updated
Attributes
.
get
(
attributeName
));
}
isClassificationUpdated
=
true
;
}
// check for validity period update
List
<
TimeBoundary
>
currentValidityPeriods
=
currentClassification
.
getValidityPeriods
();
List
<
TimeBoundary
>
updatedValidityPeriods
=
classification
.
getValidityPeriods
();
if
(!
Objects
.
equals
(
currentValidityPeriods
,
updatedValidityPeriods
))
{
currentClassification
.
setValidityPeriods
(
updatedValidityPeriods
);
isClassificationUpdated
=
true
;
}
if
(
isClassificationUpdated
&&
CollectionUtils
.
isEmpty
(
entitiesToPropagateTo
))
{
entitiesToPropagateTo
=
graphHelper
.
getImpactedVertices
(
guid
);
}
if
(
LOG
.
isDebugEnabled
())
{
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphRetriever.java
View file @
45d3872b
...
...
@@ -17,6 +17,7 @@
*/
package
org
.
apache
.
atlas
.
repository
.
store
.
graph
.
v1
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
org.apache.atlas.AtlasErrorCode
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.TimeBoundary
;
...
...
@@ -100,8 +101,8 @@ public final class EntityGraphRetriever {
private
final
String
CREATE_TIME
=
"createTime"
;
private
final
String
QUALIFIED_NAME
=
"qualifiedName"
;
private
static
final
List
<
TimeBoundary
>
TIME_BOUNDARIES_LIST
=
new
ArrayList
<>()
;
private
static
final
GraphHelper
graphHelper
=
GraphHelper
.
getInstance
();
private
static
final
TypeReference
<
List
<
TimeBoundary
>>
TIME_BOUNDARIES_LIST_TYPE
=
new
TypeReference
<
List
<
TimeBoundary
>>()
{}
;
private
static
final
GraphHelper
graphHelper
=
GraphHelper
.
getInstance
();
private
final
AtlasTypeRegistry
typeRegistry
;
...
...
@@ -249,7 +250,7 @@ public final class EntityGraphRetriever {
String
strValidityPeriods
=
AtlasGraphUtilsV1
.
getProperty
(
classificationVertex
,
CLASSIFICATION_VALIDITY_PERIODS_KEY
,
String
.
class
);
if
(
strValidityPeriods
!=
null
)
{
ret
.
setValidityPeriods
(
AtlasJson
.
fromJson
(
strValidityPeriods
,
TIME_BOUNDARIES_LIST
.
getClass
()
));
ret
.
setValidityPeriods
(
AtlasJson
.
fromJson
(
strValidityPeriods
,
TIME_BOUNDARIES_LIST
_TYPE
));
}
mapAttributes
(
classificationVertex
,
ret
,
null
);
...
...
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