Class NetgroupCache

java.lang.Object
org.apache.hadoop.security.NetgroupCache

@LimitedPrivate({"HDFS","MapReduce"}) @Unstable public class NetgroupCache extends Object
Class that caches the netgroups and inverts group-to-user map to user-to-group map, primarily intended for use with netgroups (as returned by getent netgrgoup) which only returns group to user mapping.
  • Constructor Details

    • NetgroupCache

      public NetgroupCache()
  • Method Details

    • getNetgroups

      public static void getNetgroups(String user, List<String> groups)
      Get netgroups for a given user
      Parameters:
      user - get groups for this user
      groups - put groups into this List
    • getNetgroupNames

      public static List<String> getNetgroupNames()
      Get the list of cached netgroups
      Returns:
      list of cached groups
    • isCached

      public static boolean isCached(String group)
      Returns true if a given netgroup is cached
      Parameters:
      group - check if this group is cached
      Returns:
      true if group is cached, false otherwise
    • clear

      public static void clear()
      Clear the cache
    • add

      public static void add(String group, List<String> users)
      Add group to cache
      Parameters:
      group - name of the group to add to cache
      users - list of users for a given group