Bladeren bron

HADOOP-14659. UGI getShortUserName does not need to search the Subject. Contributed by Daryn Sharp.

Kihwal Lee 8 jaren geleden
bovenliggende
commit
b3269f7cc1

+ 1 - 4
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/UserGroupInformation.java

@@ -1678,10 +1678,7 @@ public class UserGroupInformation {
    * @return the user's name up to the first '/' or '@'.
    */
   public String getShortUserName() {
-    for (User p: subject.getPrincipals(User.class)) {
-      return p.getShortName();
-    }
-    return null;
+    return user.getShortName();
   }
 
   public String getPrimaryGroupName() throws IOException {