@LimitedPrivate({"HDFS","MapReduce"})
@Evolving
public class Groups
extends java.lang.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 | Description |
|---|---|
Groups(Configuration conf) |
|
Groups(Configuration conf,
Timer timer) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
cacheGroupsAdd(java.util.List<java.lang.String> groups) |
Add groups to cache
|
long |
getBackgroundRefreshException() |
|
long |
getBackgroundRefreshQueued() |
|
long |
getBackgroundRefreshRunning() |
|
long |
getBackgroundRefreshSuccess() |
|
java.util.List<java.lang.String> |
getGroups(java.lang.String user) |
Deprecated.
Use
getGroupsSet(String user) instead. |
java.util.Set<java.lang.String> |
getGroupsSet(java.lang.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.
|
static Groups |
getUserToGroupsMappingServiceWithLoadedConfiguration(Configuration conf) |
Create new groups used to map user-to-groups with loaded configuration.
|
void |
refresh() |
Refresh all user-to-groups mappings.
|
static void |
reset() |
public Groups(Configuration conf)
public Groups(Configuration conf, Timer timer)
@Deprecated
public java.util.List<java.lang.String> getGroups(java.lang.String user)
throws java.io.IOException
getGroupsSet(String user) instead.user - User's namejava.io.IOException - if user does not existpublic java.util.Set<java.lang.String> getGroupsSet(java.lang.String user)
throws java.io.IOException
user - User's namejava.io.IOException - if user does not existpublic long getBackgroundRefreshSuccess()
public long getBackgroundRefreshException()
public long getBackgroundRefreshQueued()
public long getBackgroundRefreshRunning()
public void refresh()
public void cacheGroupsAdd(java.util.List<java.lang.String> groups)
groups - list of groups to add to cachepublic static Groups getUserToGroupsMappingService()
public static Groups getUserToGroupsMappingService(Configuration conf)
conf - configuration.@Private public static Groups getUserToGroupsMappingServiceWithLoadedConfiguration(Configuration conf)
conf - configuration.@VisibleForTesting public static void reset()
Copyright © 2008–2025 Apache Software Foundation. All rights reserved.