YARN-6271. yarn rmadin -getGroups returns information from standby RM. Contributed by Jian He.
(cherry picked from commit 8db7a8c3ae
)
This commit is contained in:
parent
30b43a2d4e
commit
a58dfcb421
|
@ -572,6 +572,15 @@ public class AdminService extends CompositeService implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] getGroupsForUser(String user) throws IOException {
|
public String[] getGroupsForUser(String user) throws IOException {
|
||||||
|
String operation = "getGroupsForUser";
|
||||||
|
UserGroupInformation ugi;
|
||||||
|
try {
|
||||||
|
ugi = checkAcls(operation);
|
||||||
|
} catch (YarnException e) {
|
||||||
|
// The interface is from hadoop-common which does not accept YarnException
|
||||||
|
throw new IOException(e);
|
||||||
|
}
|
||||||
|
checkRMStatus(ugi.getShortUserName(), operation, "get groups for user");
|
||||||
return UserGroupInformation.createRemoteUser(user).getGroupNames();
|
return UserGroupInformation.createRemoteUser(user).getGroupNames();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue