slfan1989 commented on code in PR #5057: URL: https://github.com/apache/hadoop/pull/5057#discussion_r1010003023
########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/RouterServerUtil.java: ########## @@ -491,4 +514,24 @@ public static SubClusterId getRandomActiveSubCluster( // Randomly choose a SubCluster return subClusterIds.get(rand.nextInt(subClusterIds.size())); } + + public static UserGroupInformation setupUser(String userName) { + UserGroupInformation user = null; + try { + // Do not create a proxy user if user name matches the user name on + // current UGI + if (UserGroupInformation.isSecurityEnabled()) { + user = UserGroupInformation.createProxyUser(userName, UserGroupInformation.getLoginUser()); + } else if (userName.equalsIgnoreCase(UserGroupInformation.getCurrentUser().getUserName())) { Review Comment: Thank you very much for your help reviewing the code, I will fix it. ########## hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-router/src/main/java/org/apache/hadoop/yarn/server/router/RouterServerUtil.java: ########## @@ -491,4 +514,24 @@ public static SubClusterId getRandomActiveSubCluster( // Randomly choose a SubCluster return subClusterIds.get(rand.nextInt(subClusterIds.size())); } + + public static UserGroupInformation setupUser(String userName) { Review Comment: I will fix it. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org