You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2022/11/01 01:48:23 UTC

[GitHub] [hadoop] slfan1989 commented on a diff in pull request #5057: YARN-11359. [Federation] Routing admin invocations transparently to multiple RMs.

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-unsubscribe@hadoop.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org