@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"}) @InterfaceStability.Evolving public class JniBasedUnixGroupsNetgroupMapping extends JniBasedUnixGroupsMapping
GroupMappingServiceProvider
that invokes libC calls to get the group
memberships of a given user.Constructor and Description |
---|
JniBasedUnixGroupsNetgroupMapping() |
Modifier and Type | Method and Description |
---|---|
void |
cacheGroupsAdd(List<String> groups)
Add a group to cache, only netgroups are cached
|
void |
cacheGroupsRefresh()
Refresh the netgroup cache
|
List<String> |
getGroups(String user)
Gets unix groups and netgroups for the user.
|
protected List<String> |
getUsersForNetgroup(String netgroup)
Calls JNI function to get users for a netgroup, since C functions
are not reentrant we need to make this synchronized (see
documentation for setnetgrent, getnetgrent and endnetgrent)
|
public List<String> getGroups(String user) throws IOException
getGroups
in interface GroupMappingServiceProvider
getGroups
in class JniBasedUnixGroupsMapping
user
- User's nameIOException
public void cacheGroupsRefresh() throws IOException
cacheGroupsRefresh
in interface GroupMappingServiceProvider
cacheGroupsRefresh
in class JniBasedUnixGroupsMapping
IOException
public void cacheGroupsAdd(List<String> groups) throws IOException
cacheGroupsAdd
in interface GroupMappingServiceProvider
cacheGroupsAdd
in class JniBasedUnixGroupsMapping
groups
- list of group names to add to cacheIOException
protected List<String> getUsersForNetgroup(String netgroup)
netgroup
- return users for this netgroupCopyright © 2013 Apache Software Foundation. All rights reserved.