本文整理了Java中org.apache.hadoop.util.Shell.getGroupsForUserCommand()
方法的一些代码示例,展示了Shell.getGroupsForUserCommand()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shell.getGroupsForUserCommand()
方法的具体详情如下:
包路径:org.apache.hadoop.util.Shell
类名称:Shell
方法名:getGroupsForUserCommand
[英]a Unix command to get a given user's groups list
[中]获取给定用户组列表的Unix命令
代码示例来源:origin: org.apache.hadoop/hadoop-common
/**
* Returns just the shell command to be used to fetch a user's groups 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[] getGroupsForUserCommand(String userName) {
return Shell.getGroupsForUserCommand(userName);
}
代码示例来源:origin: io.hops/hadoop-common
/**
* Create a ShellCommandExecutor object using the user's name.
*
* @param userName user's name
* @return a ShellCommandExecutor object
*/
protected ShellCommandExecutor createGroupExecutor(String userName) {
return new ShellCommandExecutor(
Shell.getGroupsForUserCommand(userName), null, null, 0L);
}
代码示例来源:origin: com.github.jiayuhan-it/hadoop-common
String result = "";
try {
result = Shell.execCommand(Shell.getGroupsForUserCommand(user));
} catch (ExitCodeException e) {
代码示例来源:origin: ch.cern.hadoop/hadoop-common
String result = "";
try {
result = Shell.execCommand(Shell.getGroupsForUserCommand(user));
} catch (ExitCodeException e) {
代码示例来源:origin: io.prestosql.hadoop/hadoop-apache
String result = "";
try {
result = Shell.execCommand(Shell.getGroupsForUserCommand(user));
} catch (ExitCodeException e) {
内容来源于网络,如有侵权,请联系作者删除!