Commit 39ff496f by Ashutosh Mestry

ATLAS-3989: Updated Export-Import Audits Writer to use metadata.namespace.

parent f5db98b3
...@@ -26,6 +26,7 @@ public final class AtlasConstants { ...@@ -26,6 +26,7 @@ public final class AtlasConstants {
} }
public static final String CLUSTER_NAME_KEY = "atlas.cluster.name"; 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 DEFAULT_CLUSTER_NAME = "primary";
public static final String SYSTEM_PROPERTY_APP_PORT = "atlas.app.port"; public static final String SYSTEM_PROPERTY_APP_PORT = "atlas.app.port";
public static final String ATLAS_REST_ADDRESS_KEY = "atlas.rest.address"; public static final String ATLAS_REST_ADDRESS_KEY = "atlas.rest.address";
......
...@@ -120,13 +120,17 @@ public class AuditsWriter { ...@@ -120,13 +120,17 @@ public class AuditsWriter {
} }
public static String getCurrentClusterName() { public static String getCurrentClusterName() {
String ret = StringUtils.EMPTY;
try { 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) { } catch (AtlasException e) {
LOG.error("getCurrentClusterName", e); LOG.error("getCurrentClusterName", e);
} }
return StringUtils.EMPTY; return ret;
} }
static String getServerNameFromFullName(String fullName) { static String getServerNameFromFullName(String fullName) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment