hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmcc...@apache.org
Subject hadoop git commit: HDFS-9942. Add an HTrace span when refreshing the groups for a username (cmccabe)
Date Fri, 11 Mar 2016 20:27:20 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 1c96fd0a2 -> b67b5b09a


HDFS-9942. Add an HTrace span when refreshing the groups for a username (cmccabe)

(cherry picked from commit 6e9a582eb1ab040f532fbe95694f5272cda34188)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/b67b5b09
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/b67b5b09
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/b67b5b09

Branch: refs/heads/branch-2
Commit: b67b5b09a7eee9c56b4ff6855b1912c188a82cbd
Parents: 1c96fd0
Author: Colin Patrick Mccabe <cmccabe@cloudera.com>
Authored: Fri Mar 11 12:26:40 2016 -0800
Committer: Colin Patrick Mccabe <cmccabe@cloudera.com>
Committed: Fri Mar 11 12:27:12 2016 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/security/Groups.java    | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b67b5b09/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java
index 9fd39b0..11d8f2a 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/Groups.java
@@ -27,6 +27,8 @@ import java.util.Set;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 
+import org.apache.htrace.core.TraceScope;
+import org.apache.htrace.core.Tracer;
 import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Ticker;
 import com.google.common.cache.CacheBuilder;
@@ -217,7 +219,20 @@ public class Groups {
      */
     @Override
     public List<String> load(String user) throws Exception {
-      List<String> groups = fetchGroupList(user);
+      TraceScope scope = null;
+      Tracer tracer = Tracer.curThreadTracer();
+      if (tracer != null) {
+        scope = tracer.newScope("Groups#fetchGroupList");
+        scope.addKVAnnotation("user", user);
+      }
+      List<String> groups = null;
+      try {
+        groups = fetchGroupList(user);
+      } finally {
+        if (scope != null) {
+          scope.close();
+        }
+      }
 
       if (groups.isEmpty()) {
         if (isNegativeCacheEnabled()) {


Mime
View raw message