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
28fb3cc6
Commit
28fb3cc6
authored
Dec 07, 2017
by
Madhan Neethiraj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2301: fix for concurrent-modification error while purging entity attributes
parent
1d0a1356
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
32 deletions
+7
-32
Struct.java
.../main/java/org/apache/atlas/v1/model/instance/Struct.java
+0
-7
EntityAuditListener.java
...rg/apache/atlas/repository/audit/EntityAuditListener.java
+3
-21
NotificationEntityChangeListener.java
.../atlas/notification/NotificationEntityChangeListener.java
+4
-4
No files found.
intg/src/main/java/org/apache/atlas/v1/model/instance/Struct.java
View file @
28fb3cc6
...
...
@@ -123,13 +123,6 @@ public class Struct implements Serializable {
return
values
!=
null
?
values
.
get
(
attrName
)
:
null
;
}
@JsonIgnore
public
void
setNull
(
String
attrName
)
{
if
(
values
!=
null
)
{
values
.
remove
(
attrName
);
}
}
public
void
normalize
()
{
if
(
MapUtils
.
isEmpty
(
values
))
{
return
;
...
...
repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListener.java
View file @
28fb3cc6
...
...
@@ -158,11 +158,11 @@ public class EntityAuditListener implements EntityChangeListener {
Map
<
String
,
Object
>
attrValues
=
entity
.
getValuesMap
();
clearAttributeValues
(
entity
);
entity
.
setValues
(
null
);
auditString
=
auditPrefix
+
AtlasType
.
toV1Json
(
entity
);
addAttributeValues
(
entity
,
attrValues
);
entity
.
setValues
(
attrValues
);
}
restoreEntityAttributes
(
entity
,
prunedAttributes
);
...
...
@@ -170,24 +170,6 @@ public class EntityAuditListener implements EntityChangeListener {
return
auditString
;
}
private
void
clearAttributeValues
(
Referenceable
entity
)
throws
AtlasException
{
Map
<
String
,
Object
>
attributesMap
=
entity
.
getValuesMap
();
if
(
MapUtils
.
isNotEmpty
(
attributesMap
))
{
for
(
String
attribute
:
attributesMap
.
keySet
())
{
entity
.
setNull
(
attribute
);
}
}
}
private
void
addAttributeValues
(
Referenceable
entity
,
Map
<
String
,
Object
>
attributesMap
)
throws
AtlasException
{
if
(
MapUtils
.
isNotEmpty
(
attributesMap
))
{
for
(
String
attr
:
attributesMap
.
keySet
())
{
entity
.
set
(
attr
,
attributesMap
.
get
(
attr
));
}
}
}
private
Map
<
String
,
Object
>
pruneEntityAttributesForAudit
(
Referenceable
entity
)
throws
AtlasException
{
Map
<
String
,
Object
>
ret
=
null
;
Map
<
String
,
Object
>
entityAttributes
=
entity
.
getValuesMap
();
...
...
@@ -205,7 +187,7 @@ public class EntityAuditListener implements EntityChangeListener {
}
ret
.
put
(
attrName
,
attrValue
);
entity
.
setNull
(
attrName
);
entity
Attributes
.
remove
(
attrName
);
}
else
if
(
attribute
.
isOwnedRef
())
{
if
(
attrValue
instanceof
Collection
)
{
for
(
Object
arrElem
:
(
Collection
)
attrValue
)
{
...
...
webapp/src/main/java/org/apache/atlas/notification/NotificationEntityChangeListener.java
View file @
28fb3cc6
...
...
@@ -160,10 +160,10 @@ public class NotificationEntityChangeListener implements EntityChangeListener {
List
<
String
>
entityNotificationAttrs
=
getNotificationAttributes
(
entity
.
getTypeName
());
if
(
MapUtils
.
isNotEmpty
(
attributesMap
)
&&
CollectionUtils
.
isNotEmpty
(
entityNotificationAttrs
))
{
for
(
String
entityAttr
:
attributesMap
.
keySet
())
{
if
(!
entityNotificationAttrs
.
contains
(
entityAttr
))
{
entity
.
setNull
(
entityAttr
);
}
Collection
<
String
>
attributesToRemove
=
CollectionUtils
.
subtract
(
attributesMap
.
keySet
(),
entityNotificationAttrs
);
for
(
String
attributeToRemove
:
attributesToRemove
)
{
attributesMap
.
remove
(
attributeToRemove
);
}
}
...
...
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