本文整理了Java中org.apache.hadoop.util.Shell.getGroupsIDForUserCommand()
方法的一些代码示例,展示了Shell.getGroupsIDForUserCommand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getGroupsIDForUserCommand()
方法的具体详情如下:
包路径:org.apache.hadoop.util.Shell
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!