This is an automated email from the ASF dual-hosted git repository. madhan 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 6eb72fa ATLAS-3621: updated HiveHook to not save query-string in multiple attributes - queryText and name - #2 (avoid excessive logs) 6eb72fa is described below commit 6eb72fa456e527baeb144245421e29bffa98592b Author: Madhan Neethiraj <mad...@apache.org> AuthorDate: Fri Feb 21 16:42:25 2020 -0800 ATLAS-3621: updated HiveHook to not save query-string in multiple attributes - queryText and name - #2 (avoid excessive logs) --- .../atlas/notification/preprocessor/HivePreprocessor.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/webapp/src/main/java/org/apache/atlas/notification/preprocessor/HivePreprocessor.java b/webapp/src/main/java/org/apache/atlas/notification/preprocessor/HivePreprocessor.java index 4bb279d..e69d63e 100644 --- a/webapp/src/main/java/org/apache/atlas/notification/preprocessor/HivePreprocessor.java +++ b/webapp/src/main/java/org/apache/atlas/notification/preprocessor/HivePreprocessor.java @@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.Objects; public class HivePreprocessor { private static final Logger LOG = LoggerFactory.getLogger(HivePreprocessor.class); @@ -163,11 +164,14 @@ public class HivePreprocessor { @Override public void preprocess(AtlasEntity entity, PreprocessorContext context) { if (context.updateHiveProcessNameWithQualifiedName()) { - if (LOG.isDebugEnabled()) { - LOG.debug("setting {}.name={}. topic-offset={}, partition={}", entity.getTypeName(), entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME), context.getKafkaMessageOffset(), context.getKafkaPartition()); - } + Object name = entity.getAttribute(ATTRIBUTE_NAME); + Object qualifiedName = entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME); + + if (!Objects.equals(name, qualifiedName)) { + LOG.info("setting {}.name={}. topic-offset={}, partition={}", entity.getTypeName(), qualifiedName, context.getKafkaMessageOffset(), context.getKafkaPartition()); - entity.setAttribute(ATTRIBUTE_NAME, entity.getAttribute(ATTRIBUTE_QUALIFIED_NAME)); + entity.setAttribute(ATTRIBUTE_NAME, qualifiedName); + } } if (context.isIgnoredEntity(entity.getGuid())) {