Repository: atlas Updated Branches: refs/heads/branch-0.8 4b8be64e7 -> 7b131c06a
ATLAS-2909: ChangeMarker updated during initialization. Project: http://git-wip-us.apache.org/repos/asf/atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/7b131c06 Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/7b131c06 Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/7b131c06 Branch: refs/heads/branch-0.8 Commit: 7b131c06a9d988fd69e60b69b8ae6f70c2f7e22d Parents: 4b8be64 Author: Ashutosh Mestry <[email protected]> Authored: Sun Oct 7 22:59:00 2018 -0700 Committer: Ashutosh Mestry <[email protected]> Committed: Sun Oct 7 22:59:00 2018 -0700 ---------------------------------------------------------------------- .../repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java | 2 +- server-api/src/main/java/org/apache/atlas/RequestContextV1.java | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/atlas/blob/7b131c06/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java index 6e428d0..b201ba8 100644 --- a/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java +++ b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasTypeDefGraphStoreV1.java @@ -425,7 +425,7 @@ public class AtlasTypeDefGraphStoreV1 extends AtlasTypeDefGraphStore { } private String getCurrentUser() { - String ret = RequestContextV1.get().getUser(); + String ret = RequestContextV1.getCurrentUser(); if (StringUtils.isBlank(ret)) { ret = System.getProperty("user.name"); http://git-wip-us.apache.org/repos/asf/atlas/blob/7b131c06/server-api/src/main/java/org/apache/atlas/RequestContextV1.java ---------------------------------------------------------------------- diff --git a/server-api/src/main/java/org/apache/atlas/RequestContextV1.java b/server-api/src/main/java/org/apache/atlas/RequestContextV1.java index bf6df46..b388018 100644 --- a/server-api/src/main/java/org/apache/atlas/RequestContextV1.java +++ b/server-api/src/main/java/org/apache/atlas/RequestContextV1.java @@ -91,6 +91,11 @@ public class RequestContextV1 { return ACTIVE_REQUESTS.size(); } + public static String getCurrentUser() { + RequestContextV1 context = CURRENT_CONTEXT.get(); + return context != null ? context.getUser() : null; + } + public static long earliestActiveRequestTime() { long ret = System.currentTimeMillis();
