This is an automated email from the ASF dual-hosted git repository.
sarath pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/master by this push:
new 0a6d098 ATLAS-3360: Duplicate audits in atlas when HMS and hive hook
is enabled.
0a6d098 is described below
commit 0a6d098c8f88bc6e51632901674b4d45dd472d5d
Author: Saqeeb Shaikh <[email protected]>
AuthorDate: Wed Aug 14 14:12:48 2019 -0700
ATLAS-3360: Duplicate audits in atlas when HMS and hive hook is enabled.
Signed-off-by: Sarath Subramanian <[email protected]>
---
.../apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java | 6 ++++++
server-api/src/main/java/org/apache/atlas/RequestContext.java | 6 ++++++
2 files changed, 12 insertions(+)
diff --git
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
index 983d4fa..c495dcc 100644
---
a/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
+++
b/repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasEntityStoreV2.java
@@ -839,7 +839,13 @@ public class AtlasEntityStoreV2 implements
AtlasEntityStore {
}
if (entitiesToSkipUpdate != null) {
+ // remove entitiesToSkipUpdate from EntityMutationContext
context.getUpdatedEntities().removeAll(entitiesToSkipUpdate);
+
+ // remove entitiesToSkipUpdate from RequestContext
+ for (AtlasEntity entity : entitiesToSkipUpdate) {
+ RequestContext.get().removeEntityUpdate(entity);
+ }
}
// Check if authorized to update entities
diff --git a/server-api/src/main/java/org/apache/atlas/RequestContext.java
b/server-api/src/main/java/org/apache/atlas/RequestContext.java
index 62899b6..d518609 100644
--- a/server-api/src/main/java/org/apache/atlas/RequestContext.java
+++ b/server-api/src/main/java/org/apache/atlas/RequestContext.java
@@ -189,6 +189,12 @@ public class RequestContext {
}
}
+ public void removeEntityUpdate(AtlasEntity entity) {
+ if (entity != null && entity.getGuid() != null) {
+ updatedEntities.remove(entity.getGuid());
+ }
+ }
+
public void recordEntityDelete(AtlasEntityHeader entity) {
if (entity != null && entity.getGuid() != null) {
deletedEntities.put(entity.getGuid(), entity);