This is an automated email from the ASF dual-hosted git repository.
amestry pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/atlas.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 757282f ATLAS-3989: Updated Export-Import Audits Writer to use
metadata.namespace.
757282f is described below
commit 757282f23338fa00c2a5112b538d43818d2057d0
Author: Ashutosh Mestry <[email protected]>
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) {