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
fa989919
Commit
fa989919
authored
7 years ago
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2590: Tag Propagation : Editing tag attributes without specifying propagate flag value
parent
b03c2484
master
No related merge requests found
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
AtlasClassification.java
.../org/apache/atlas/model/instance/AtlasClassification.java
+4
-4
EntityGraphMapper.java
...he/atlas/repository/store/graph/v1/EntityGraphMapper.java
+11
-5
EntityV2JerseyResourceIT.java
...pache/atlas/web/integration/EntityV2JerseyResourceIT.java
+1
-0
No files found.
intg/src/main/java/org/apache/atlas/model/instance/AtlasClassification.java
View file @
fa989919
...
...
@@ -54,7 +54,7 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
String
entityGuid
=
null
;
private
boolean
propagate
=
true
;
private
Boolean
propagate
=
null
;
private
List
<
TimeBoundary
>
validityPeriods
=
null
;
public
enum
PropagationState
{
ACTIVE
,
DELETED
}
...
...
@@ -94,11 +94,11 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
this
.
entityGuid
=
entityGuid
;
}
public
b
oolean
isPropagate
()
{
public
B
oolean
isPropagate
()
{
return
propagate
;
}
public
void
setPropagate
(
b
oolean
propagate
)
{
public
void
setPropagate
(
B
oolean
propagate
)
{
this
.
propagate
=
propagate
;
}
...
...
@@ -129,7 +129,7 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
if
(!
super
.
equals
(
o
))
{
return
false
;
}
AtlasClassification
that
=
(
AtlasClassification
)
o
;
return
propagate
==
that
.
propagate
&&
return
Objects
.
equals
(
propagate
,
that
.
propagate
)
&&
Objects
.
equals
(
entityGuid
,
that
.
entityGuid
)
&&
Objects
.
equals
(
validityPeriods
,
that
.
validityPeriods
);
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java
View file @
fa989919
...
...
@@ -1328,7 +1328,11 @@ public class EntityGraphMapper {
for
(
AtlasClassification
classification
:
classifications
)
{
String
classificationName
=
classification
.
getTypeName
();
boolean
propagateTags
=
classification
.
isPropagate
();
Boolean
propagateTags
=
classification
.
isPropagate
();
if
(
propagateTags
==
null
)
{
propagateTags
=
true
;
}
// set associated entity id to classification
classification
.
setEntityGuid
(
guid
);
...
...
@@ -1554,11 +1558,11 @@ public class EntityGraphMapper {
mapClassification
(
EntityOperation
.
UPDATE
,
context
,
classification
,
entityType
,
entityVertex
,
classificationVertex
);
// handle update of 'propagate' flag
b
oolean
currentTagPropagation
=
currentClassification
.
isPropagate
();
b
oolean
updatedTagPropagation
=
classification
.
isPropagate
();
B
oolean
currentTagPropagation
=
currentClassification
.
isPropagate
();
B
oolean
updatedTagPropagation
=
classification
.
isPropagate
();
// compute propagatedEntityVertices once and use it for subsequent iterations and notifications
if
(
currentTagPropagation
!=
updatedTagPropagation
)
{
if
(
updatedTagPropagation
!=
null
&&
currentTagPropagation
!=
updatedTagPropagation
)
{
if
(
updatedTagPropagation
)
{
if
(
CollectionUtils
.
isEmpty
(
entitiesToPropagateTo
))
{
entitiesToPropagateTo
=
graphHelper
.
getImpactedVertices
(
guid
);
...
...
@@ -1687,7 +1691,9 @@ public class EntityGraphMapper {
// if 'null', don't update existing value in the classification
}
AtlasGraphUtilsV1
.
setProperty
(
traitInstanceVertex
,
Constants
.
CLASSIFICATION_VERTEX_PROPAGATE_KEY
,
classification
.
isPropagate
());
if
(
classification
.
isPropagate
()
!=
null
)
{
AtlasGraphUtilsV1
.
setProperty
(
traitInstanceVertex
,
Constants
.
CLASSIFICATION_VERTEX_PROPAGATE_KEY
,
classification
.
isPropagate
());
}
// map all the attributes to this newly created AtlasVertex
mapAttributes
(
classification
,
traitInstanceVertex
,
operation
,
context
);
...
...
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
View file @
fa989919
...
...
@@ -464,6 +464,7 @@ public class EntityV2JerseyResourceIT extends BaseResourceIT {
classification
.
setEntityGuid
(
tableGuid
);
classification
.
addValityPeriod
(
validityPeriod
);
classification
.
setPropagate
(
true
);
atlasClientV2
.
addClassifications
(
tableGuid
,
Collections
.
singletonList
(
classification
));
...
...
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