|
@@ -35,19 +35,12 @@ import org.apache.hadoop.util.Shell.ExitCodeException;
|
|
* memberships of a given user.
|
|
* memberships of a given user.
|
|
*/
|
|
*/
|
|
public class ShellBasedUnixGroupsMapping implements GroupMappingServiceProvider {
|
|
public class ShellBasedUnixGroupsMapping implements GroupMappingServiceProvider {
|
|
- Map<String, List<String>> userGroups =
|
|
|
|
- new ConcurrentHashMap<String, List<String>>();
|
|
|
|
|
|
|
|
private static final Log LOG = LogFactory.getLog(ShellBasedUnixGroupsMapping.class);
|
|
private static final Log LOG = LogFactory.getLog(ShellBasedUnixGroupsMapping.class);
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<String> getGroups(String user) throws IOException {
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|