浏览代码

HADOOP-6652. Removes the unnecessary cache from ShellBasedUnixGroupsMapping. Contributed by Devaraj Das.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@954612 13f79535-47bb-0310-9956-ffa450edef68
Devaraj Das 15 年之前
父节点
当前提交
e89ac4b077
共有 2 个文件被更改,包括 4 次插入8 次删除
  1. 3 0
      CHANGES.txt
  2. 1 8
      src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java

+ 3 - 0
CHANGES.txt

@@ -88,6 +88,9 @@ Trunk (unreleased changes)
     HADOOP-6682. NetUtils:normalizeHostName does not process hostnames starting
     with [a-f] correctly. (jghoman)
 
+    HADOOP-6652. Removes the unnecessary cache from ShellBasedUnixGroupsMapping.
+    (ddas)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

+ 1 - 8
src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java

@@ -39,19 +39,12 @@ import org.apache.hadoop.util.Shell.ExitCodeException;
 @InterfaceAudience.LimitedPrivate({"HDFS", "MapReduce"})
 @InterfaceStability.Evolving
 public class ShellBasedUnixGroupsMapping implements GroupMappingServiceProvider {
-  Map<String, List<String>> userGroups = 
-    new ConcurrentHashMap<String, List<String>>();
   
   private static final Log LOG = LogFactory.getLog(ShellBasedUnixGroupsMapping.class);
   
   @Override
   public List<String> getGroups(String user) throws IOException {
-    List<String> groups = userGroups.get(user);
-    if (groups == null) {
-      groups = getUnixGroups(user);
-      userGroups.put(user, groups);
-    }
-    return groups;
+    return getUnixGroups(user);
   }
 
   /**