@InterfaceAudience.LimitedPrivate(value={"HDFS","MapReduce"}) @InterfaceStability.Evolving public class Groups extends Object
Groups
allows for server to get the various group memberships
of a given user via the getGroups(String)
call, thus ensuring
a consistent user-to-groups mapping and protects against vagaries of
different mappings on servers and clients in a Hadoop cluster.Constructor and Description |
---|
Groups(Configuration conf) |
Modifier and Type | Method and Description |
---|---|
void |
cacheGroupsAdd(List<String> groups)
Add groups to cache
|
List<String> |
getGroups(String user)
Get the group memberships of a given user.
|
static Groups |
getUserToGroupsMappingService()
Get the groups being used to map user-to-groups.
|
static Groups |
getUserToGroupsMappingService(Configuration conf)
Get the groups being used to map user-to-groups.
|
void |
refresh()
Refresh all user-to-groups mappings.
|
public Groups(Configuration conf)
public List<String> getGroups(String user) throws IOException
user
- User's nameIOException
public void refresh()
public void cacheGroupsAdd(List<String> groups)
groups
- list of groups to add to cachepublic static Groups getUserToGroupsMappingService()
public static Groups getUserToGroupsMappingService(Configuration conf)
conf
- Copyright © 2013 Apache Software Foundation. All rights reserved.