Configurable, GroupMappingServiceProviderShellBasedUnixGroupsNetgroupMapping@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public class ShellBasedUnixGroupsMapping
extends Configured
implements GroupMappingServiceProvider
GroupMappingServiceProvider
that exec's the groups shell command to fetch the group
memberships of a given user.| Modifier and Type | Field | Description |
|---|---|---|
protected static org.slf4j.Logger |
LOG |
GROUP_MAPPING_CONFIG_PREFIX| Constructor | Description |
|---|---|
ShellBasedUnixGroupsMapping() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
cacheGroupsAdd(java.util.List<java.lang.String> groups) |
Adds groups to cache, no need to do that for this provider
|
void |
cacheGroupsRefresh() |
Caches groups, no need to do that for this provider
|
protected Shell.ShellCommandExecutor |
createGroupExecutor(java.lang.String userName) |
Create a ShellCommandExecutor object using the user's name.
|
protected Shell.ShellCommandExecutor |
createGroupIDExecutor(java.lang.String userName) |
Create a ShellCommandExecutor object for fetch a user's group id list.
|
java.util.List<java.lang.String> |
getGroups(java.lang.String userName) |
Returns list of groups for a user
|
protected java.lang.String[] |
getGroupsForUserCommand(java.lang.String userName) |
Returns just the shell command to be used to fetch a user's groups list.
|
protected java.lang.String[] |
getGroupsIDForUserCommand(java.lang.String userName) |
Returns just the shell command to be used to fetch a user's group IDs list.
|
java.util.Set<java.lang.String> |
getGroupsSet(java.lang.String userName) |
Get all various group memberships of a given user.
|
protected java.util.Set<java.lang.String> |
resolveFullGroupNames(java.lang.String groupNames) |
Split group names into a set.
|
void |
setConf(Configuration conf) |
Set the configuration to be used by this object.
|
getConfpublic void setConf(Configuration conf)
ConfigurablesetConf in interface ConfigurablesetConf in class Configuredconf - configuration to be usedpublic java.util.List<java.lang.String> getGroups(java.lang.String userName)
throws java.io.IOException
getGroups in interface GroupMappingServiceProvideruserName - get groups for this userjava.io.IOException - raised on errors performing I/O.public void cacheGroupsRefresh()
throws java.io.IOException
cacheGroupsRefresh in interface GroupMappingServiceProviderjava.io.IOException - raised on errors performing I/O.public void cacheGroupsAdd(java.util.List<java.lang.String> groups)
throws java.io.IOException
cacheGroupsAdd in interface GroupMappingServiceProvidergroups - unusedjava.io.IOException - raised on errors performing I/O.public java.util.Set<java.lang.String> getGroupsSet(java.lang.String userName)
throws java.io.IOException
GroupMappingServiceProvidergetGroupsSet in interface GroupMappingServiceProvideruserName - User's namejava.io.IOException - raised on errors performing I/O.protected Shell.ShellCommandExecutor createGroupExecutor(java.lang.String userName)
userName - user's nameprotected java.lang.String[] getGroupsForUserCommand(java.lang.String userName)
userName - The username that needs to be passed into the command builtprotected Shell.ShellCommandExecutor createGroupIDExecutor(java.lang.String userName)
userName - the user's nameprotected java.lang.String[] getGroupsIDForUserCommand(java.lang.String userName)
userName - The username that needs to be passed into the command built@VisibleForTesting protected java.util.Set<java.lang.String> resolveFullGroupNames(java.lang.String groupNames)
groupNames - a string representing the user's group namesCopyright © 2008–2025 Apache Software Foundation. All rights reserved.