This is an automated email from the ASF dual-hosted git repository.

pinal 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 a5eb42626 ATLAS-4666 : Intermittently, the audits for creation of 
hive_db registered are different than expected
a5eb42626 is described below

commit a5eb426263632034513ba7013913b57875ec7c5f
Author: Mandar Ambawane <mandar.ambaw...@freestoneinfotech.com>
AuthorDate: Tue Sep 6 10:38:44 2022 +0530

    ATLAS-4666 : Intermittently, the audits for creation of hive_db registered 
are different than expected
    
    Signed-off-by: Pinal Shah <pinal.s...@freestoneinfotech.com>
---
 .../org/apache/atlas/repository/audit/EntityAuditListenerV2.java | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git 
a/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
 
b/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
index d48c91709..9b011ab06 100644
--- 
a/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
+++ 
b/repository/src/main/java/org/apache/atlas/repository/audit/EntityAuditListenerV2.java
@@ -128,6 +128,8 @@ public class EntityAuditListenerV2 implements 
EntityChangeListenerV2 {
                 action = CUSTOM_ATTRIBUTE_UPDATE;
             } else if 
(reqContext.checkIfEntityIsForBusinessAttributeUpdate(entity.getGuid())) {
                 action = BUSINESS_ATTRIBUTE_UPDATE;
+            } else if (isShellEntity(entity)) {
+                action = ENTITY_CREATE;
             } else {
                 action = ENTITY_UPDATE;
             }
@@ -651,4 +653,11 @@ public class EntityAuditListenerV2 implements 
EntityChangeListenerV2 {
         return ret;
 
     }
+
+    private boolean isShellEntity(AtlasEntity entity) {
+        if (entity.getIsIncomplete() != null && entity.getCreateTime() != null 
&& entity.getUpdateTime() != null) {
+            return entity.getIsIncomplete() && 
entity.getCreateTime().getTime() == entity.getUpdateTime().getTime();
+        }
+        return false;
+    }
 }

Reply via email to