org.apache.hadoop.util.Shell.getGroupsIDForUserCommand()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中org.apache.hadoop.util.Shell.getGroupsIDForUserCommand()方法的一些代码示例,展示了Shell.getGroupsIDForUserCommand()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getGroupsIDForUserCommand()方法的具体详情如下:
包路径:org.apache.hadoop.util.Shell
类名称:Shell
方法名:getGroupsIDForUserCommand

Shell.getGroupsIDForUserCommand介绍

[英]A command to get a given user's group id list. The command will get the user's primary group first and finally get the groups list which includes the primary group. i.e. the user's primary group will be included twice. This command does not support Windows and will only return group names.
[中]获取给定用户组id列表的命令。该命令将首先获取用户的主组,最后获取包含主组的组列表。i、 e.用户的主要组将包含两次。此命令不支持Windows,只返回组名。

代码示例

代码示例来源:origin: org.apache.hadoop/hadoop-common

/**
 * Returns just the shell command to be used to fetch a user's group IDs list.
 * This is mainly separate to make some tests easier.
 * @param userName The username that needs to be passed into the command built
 * @return An appropriate shell command with arguments
 */
protected String[] getGroupsIDForUserCommand(String userName) {
 return Shell.getGroupsIDForUserCommand(userName);
}

代码示例来源:origin: io.hops/hadoop-common

/**
 * Create a ShellCommandExecutor object for fetch a user's group id list.
 *
 * @param userName the user's name
 * @return a ShellCommandExecutor object
 */
protected ShellCommandExecutor createGroupIDExecutor(String userName) {
 return new ShellCommandExecutor(
   Shell.getGroupsIDForUserCommand(userName), null, null, 0L);
}

相关文章

微信公众号

最新文章

更多