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
Apr 20, 2018
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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
AtlasClassification.java
.../org/apache/atlas/model/instance/AtlasClassification.java
+4
-4
EntityGraphMapper.java
...he/atlas/repository/store/graph/v1/EntityGraphMapper.java
+10
-4
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 {
...
@@ -54,7 +54,7 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
private
String
entityGuid
=
null
;
private
String
entityGuid
=
null
;
private
boolean
propagate
=
true
;
private
Boolean
propagate
=
null
;
private
List
<
TimeBoundary
>
validityPeriods
=
null
;
private
List
<
TimeBoundary
>
validityPeriods
=
null
;
public
enum
PropagationState
{
ACTIVE
,
DELETED
}
public
enum
PropagationState
{
ACTIVE
,
DELETED
}
...
@@ -94,11 +94,11 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
...
@@ -94,11 +94,11 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
this
.
entityGuid
=
entityGuid
;
this
.
entityGuid
=
entityGuid
;
}
}
public
b
oolean
isPropagate
()
{
public
B
oolean
isPropagate
()
{
return
propagate
;
return
propagate
;
}
}
public
void
setPropagate
(
b
oolean
propagate
)
{
public
void
setPropagate
(
B
oolean
propagate
)
{
this
.
propagate
=
propagate
;
this
.
propagate
=
propagate
;
}
}
...
@@ -129,7 +129,7 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
...
@@ -129,7 +129,7 @@ public class AtlasClassification extends AtlasStruct implements Serializable {
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
{
return
false
;
}
if
(!
super
.
equals
(
o
))
{
return
false
;
}
if
(!
super
.
equals
(
o
))
{
return
false
;
}
AtlasClassification
that
=
(
AtlasClassification
)
o
;
AtlasClassification
that
=
(
AtlasClassification
)
o
;
return
propagate
==
that
.
propagate
&&
return
Objects
.
equals
(
propagate
,
that
.
propagate
)
&&
Objects
.
equals
(
entityGuid
,
that
.
entityGuid
)
&&
Objects
.
equals
(
entityGuid
,
that
.
entityGuid
)
&&
Objects
.
equals
(
validityPeriods
,
that
.
validityPeriods
);
Objects
.
equals
(
validityPeriods
,
that
.
validityPeriods
);
}
}
...
...
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/EntityGraphMapper.java
View file @
fa989919
...
@@ -1328,7 +1328,11 @@ public class EntityGraphMapper {
...
@@ -1328,7 +1328,11 @@ public class EntityGraphMapper {
for
(
AtlasClassification
classification
:
classifications
)
{
for
(
AtlasClassification
classification
:
classifications
)
{
String
classificationName
=
classification
.
getTypeName
();
String
classificationName
=
classification
.
getTypeName
();
boolean
propagateTags
=
classification
.
isPropagate
();
Boolean
propagateTags
=
classification
.
isPropagate
();
if
(
propagateTags
==
null
)
{
propagateTags
=
true
;
}
// set associated entity id to classification
// set associated entity id to classification
classification
.
setEntityGuid
(
guid
);
classification
.
setEntityGuid
(
guid
);
...
@@ -1554,11 +1558,11 @@ public class EntityGraphMapper {
...
@@ -1554,11 +1558,11 @@ public class EntityGraphMapper {
mapClassification
(
EntityOperation
.
UPDATE
,
context
,
classification
,
entityType
,
entityVertex
,
classificationVertex
);
mapClassification
(
EntityOperation
.
UPDATE
,
context
,
classification
,
entityType
,
entityVertex
,
classificationVertex
);
// handle update of 'propagate' flag
// handle update of 'propagate' flag
b
oolean
currentTagPropagation
=
currentClassification
.
isPropagate
();
B
oolean
currentTagPropagation
=
currentClassification
.
isPropagate
();
b
oolean
updatedTagPropagation
=
classification
.
isPropagate
();
B
oolean
updatedTagPropagation
=
classification
.
isPropagate
();
// compute propagatedEntityVertices once and use it for subsequent iterations and notifications
// compute propagatedEntityVertices once and use it for subsequent iterations and notifications
if
(
currentTagPropagation
!=
updatedTagPropagation
)
{
if
(
updatedTagPropagation
!=
null
&&
currentTagPropagation
!=
updatedTagPropagation
)
{
if
(
updatedTagPropagation
)
{
if
(
updatedTagPropagation
)
{
if
(
CollectionUtils
.
isEmpty
(
entitiesToPropagateTo
))
{
if
(
CollectionUtils
.
isEmpty
(
entitiesToPropagateTo
))
{
entitiesToPropagateTo
=
graphHelper
.
getImpactedVertices
(
guid
);
entitiesToPropagateTo
=
graphHelper
.
getImpactedVertices
(
guid
);
...
@@ -1687,7 +1691,9 @@ public class EntityGraphMapper {
...
@@ -1687,7 +1691,9 @@ public class EntityGraphMapper {
// if 'null', don't update existing value in the classification
// if 'null', don't update existing value in the classification
}
}
if
(
classification
.
isPropagate
()
!=
null
)
{
AtlasGraphUtilsV1
.
setProperty
(
traitInstanceVertex
,
Constants
.
CLASSIFICATION_VERTEX_PROPAGATE_KEY
,
classification
.
isPropagate
());
AtlasGraphUtilsV1
.
setProperty
(
traitInstanceVertex
,
Constants
.
CLASSIFICATION_VERTEX_PROPAGATE_KEY
,
classification
.
isPropagate
());
}
// map all the attributes to this newly created AtlasVertex
// map all the attributes to this newly created AtlasVertex
mapAttributes
(
classification
,
traitInstanceVertex
,
operation
,
context
);
mapAttributes
(
classification
,
traitInstanceVertex
,
operation
,
context
);
...
...
webapp/src/test/java/org/apache/atlas/web/integration/EntityV2JerseyResourceIT.java
View file @
fa989919
...
@@ -464,6 +464,7 @@ public class EntityV2JerseyResourceIT extends BaseResourceIT {
...
@@ -464,6 +464,7 @@ public class EntityV2JerseyResourceIT extends BaseResourceIT {
classification
.
setEntityGuid
(
tableGuid
);
classification
.
setEntityGuid
(
tableGuid
);
classification
.
addValityPeriod
(
validityPeriod
);
classification
.
addValityPeriod
(
validityPeriod
);
classification
.
setPropagate
(
true
);
atlasClientV2
.
addClassifications
(
tableGuid
,
Collections
.
singletonList
(
classification
));
atlasClientV2
.
addClassifications
(
tableGuid
,
Collections
.
singletonList
(
classification
));
...
...
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