You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by am...@apache.org on 2020/10/12 05:35:41 UTC

[atlas] branch master updated: ATLAS-3989: Updated Export-Import Audits Writer to use metadata.namespace.

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

amestry 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 39ff496  ATLAS-3989: Updated Export-Import Audits Writer to use metadata.namespace.
39ff496 is described below

commit 39ff496f129b64352e91b462c7882491a3929981
Author: Ashutosh Mestry <am...@cloudera.com>
AuthorDate: Fri Oct 9 17:07:25 2020 -0700

    ATLAS-3989: Updated Export-Import Audits Writer to use metadata.namespace.
---
 common/src/main/java/org/apache/atlas/AtlasConstants.java         | 1 +
 .../java/org/apache/atlas/repository/impexp/AuditsWriter.java     | 8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/common/src/main/java/org/apache/atlas/AtlasConstants.java b/common/src/main/java/org/apache/atlas/AtlasConstants.java
index 319eb57..ce0dbd0 100644
--- a/common/src/main/java/org/apache/atlas/AtlasConstants.java
+++ b/common/src/main/java/org/apache/atlas/AtlasConstants.java
@@ -26,6 +26,7 @@ public final class AtlasConstants {
     }
 
     public static final String CLUSTER_NAME_KEY              = "atlas.cluster.name";
+    public static final String METADATA_NAMESPACE_KEY        = "atlas.metadata.namespace";
     public static final String DEFAULT_CLUSTER_NAME          = "primary";
     public static final String SYSTEM_PROPERTY_APP_PORT      = "atlas.app.port";
     public static final String ATLAS_REST_ADDRESS_KEY        = "atlas.rest.address";
diff --git a/repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java b/repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java
index 55990f7..c4de0ed 100644
--- a/repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java
+++ b/repository/src/main/java/org/apache/atlas/repository/impexp/AuditsWriter.java
@@ -120,13 +120,17 @@ public class AuditsWriter {
     }
 
     public static String getCurrentClusterName() {
+        String ret = StringUtils.EMPTY;
         try {
-            return ApplicationProperties.get().getString(AtlasConstants.CLUSTER_NAME_KEY, CLUSTER_NAME_DEFAULT);
+            ret = ApplicationProperties.get().getString(AtlasConstants.METADATA_NAMESPACE_KEY, StringUtils.EMPTY);
+            if (StringUtils.isEmpty(ret)) {
+                ret = ApplicationProperties.get().getString(AtlasConstants.CLUSTER_NAME_KEY, CLUSTER_NAME_DEFAULT);
+            }
         } catch (AtlasException e) {
             LOG.error("getCurrentClusterName", e);
         }
 
-        return StringUtils.EMPTY;
+        return ret;
     }
 
     static String getServerNameFromFullName(String fullName) {