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
This commit is contained in:
Devaraj Das 2010-06-14 20:02:56 +00:00
parent 6749f0275c
commit e89ac4b077
2 changed files with 4 additions and 8 deletions

View File

@ -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

View File

@ -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);
}
/**