hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [2/2] git commit: HDFS-7026. Introduce a string constant for "Failed to obtain user group info...". Contributed by Yongjun Zhang. (cherry picked from commit cbd21fd13b321d042faeff00fa71c9becc0d6087)
Date Fri, 10 Oct 2014 01:53:23 GMT
HDFS-7026. Introduce a string constant for "Failed to obtain user group info...". Contributed
by Yongjun Zhang.
(cherry picked from commit cbd21fd13b321d042faeff00fa71c9becc0d6087)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/8cbacb37
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/8cbacb37
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/8cbacb37

Branch: refs/heads/branch-2
Commit: 8cbacb37e9d4aa1a7dcc87a7aef7915ef72a1be6
Parents: ad47a27
Author: Aaron T. Myers <atm@apache.org>
Authored: Thu Oct 9 18:52:28 2014 -0700
Committer: Aaron T. Myers <atm@apache.org>
Committed: Thu Oct 9 18:53:03 2014 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/security/SecurityUtil.java    | 2 ++
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                       | 3 +++
 .../main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java   | 3 ++-
 .../java/org/apache/hadoop/hdfs/web/resources/UserProvider.java   | 3 ++-
 .../hdfs/server/namenode/ha/TestDelegationTokensWithHA.java       | 2 +-
 5 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/8cbacb37/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
index b5bf26f..27870c3 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/SecurityUtil.java
@@ -57,6 +57,8 @@ import com.google.common.annotations.VisibleForTesting;
 public class SecurityUtil {
   public static final Log LOG = LogFactory.getLog(SecurityUtil.class);
   public static final String HOSTNAME_PATTERN = "_HOST";
+  public static final String FAILED_TO_GET_UGI_MSG_HEADER = 
+      "Failed to obtain user group information:";
 
   // controls whether buildTokenService will use an ip or host/ip as given
   // by the user

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8cbacb37/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 6105c44..0fcf10c 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -16,6 +16,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7202. Should be able to omit package name of SpanReceiver on "hadoop
     trace -add" (iwasakims via cmccabe)
 
+    HDFS-7026. Introduce a string constant for "Failed to obtain user group
+    info...". (Yongjun Zhang via atm)
+
   OPTIMIZATIONS
 
   BUG FIXES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8cbacb37/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
index 55fba00..bfe554f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/WebHdfsFileSystem.java
@@ -355,7 +355,8 @@ public class WebHdfsFileSystem extends FileSystem
       // extract UGI-related exceptions and unwrap InvalidToken
       // the NN mangles these exceptions but the DN does not and may need
       // to re-fetch a token if either report the token is expired
-      if (re.getMessage().startsWith("Failed to obtain user group information:")) {
+      if (re.getMessage().startsWith(
+          SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER)) {
         String[] parts = re.getMessage().split(":\\s+", 3);
         re = new RemoteException(parts[1], parts[2]);
         re = ((RemoteException)re).unwrapRemoteException(InvalidToken.class);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8cbacb37/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserProvider.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserProvider.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserProvider.java
index 44e8938..32b3369 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserProvider.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/web/resources/UserProvider.java
@@ -27,6 +27,7 @@ import javax.ws.rs.ext.Provider;
 
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hdfs.server.common.JspHelper;
+import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod;
 
@@ -54,7 +55,7 @@ public class UserProvider
           AuthenticationMethod.KERBEROS, false);
     } catch (IOException e) {
       throw new SecurityException(
-          "Failed to obtain user group information: " + e, e);
+          SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER + " " + e, e);
     }
   }
 

http://git-wip-us.apache.org/repos/asf/hadoop/blob/8cbacb37/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
index 33b5350..f86e9b0 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/ha/TestDelegationTokensWithHA.java
@@ -416,7 +416,7 @@ public class TestDelegationTokensWithHA {
             // Mimic the UserProvider class logic (server side) by throwing
             // SecurityException here
             throw new SecurityException(
-                "Failed to obtain user group information: " + e, e);
+                SecurityUtil.FAILED_TO_GET_UGI_MSG_HEADER + " " + e, e);
           }
         } catch (Exception oe) {
           //


Mime
View raw message