Package org.apache.hadoop.security
Class CompositeGroupsMapping
java.lang.Object
org.apache.hadoop.security.CompositeGroupsMapping
- All Implemented Interfaces:
Configurable,GroupMappingServiceProvider
@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public class CompositeGroupsMapping
extends Object
implements GroupMappingServiceProvider, Configurable
An implementation of
GroupMappingServiceProvider which
composites other group mapping providers for determining group membership.
This allows to combine existing provider implementations and composite
a virtually new provider without customized development to deal with complex situation.-
Field Summary
FieldsFields inherited from interface org.apache.hadoop.security.GroupMappingServiceProvider
GROUP_MAPPING_CONFIG_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcacheGroupsAdd(List<String> groups) Adds groups to cache, no need to do that for this providervoidCaches groups, no need to do that for this providergetConf()Return the configuration used by this object.Returns list of groups for a user.getGroupsSet(String user) Get all various group memberships of a given user.voidsetConf(Configuration conf) Set the configuration to be used by this object.
-
Field Details
-
MAPPING_PROVIDERS_CONFIG_KEY
- See Also:
-
MAPPING_PROVIDERS_COMBINED_CONFIG_KEY
- See Also:
-
MAPPING_PROVIDER_CONFIG_PREFIX
- See Also:
-
-
Constructor Details
-
CompositeGroupsMapping
public CompositeGroupsMapping()
-
-
Method Details
-
getGroups
Returns list of groups for a user.- Specified by:
getGroupsin interfaceGroupMappingServiceProvider- Parameters:
user- get groups for this user- Returns:
- list of groups for a given user
- Throws:
IOException- raised on errors performing I/O.
-
cacheGroupsRefresh
Caches groups, no need to do that for this provider- Specified by:
cacheGroupsRefreshin interfaceGroupMappingServiceProvider- Throws:
IOException- raised on errors performing I/O.
-
cacheGroupsAdd
Adds groups to cache, no need to do that for this provider- Specified by:
cacheGroupsAddin interfaceGroupMappingServiceProvider- Parameters:
groups- unused- Throws:
IOException- raised on errors performing I/O.
-
getGroupsSet
Description copied from interface:GroupMappingServiceProviderGet all various group memberships of a given user. Returns EMPTY set in case of non-existing user- Specified by:
getGroupsSetin interfaceGroupMappingServiceProvider- Parameters:
user- User's name- Returns:
- set of group memberships of user
- Throws:
IOException- raised on errors performing I/O.
-
getConf
Description copied from interface:ConfigurableReturn the configuration used by this object.- Specified by:
getConfin interfaceConfigurable- Returns:
- Configuration
-
setConf
Description copied from interface:ConfigurableSet the configuration to be used by this object.- Specified by:
setConfin interfaceConfigurable- Parameters:
conf- configuration to be used
-