hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [1/2] git commit: HDFS-7026. Introduce a string constant for "Failed to obtain user group info...". Contributed by Yongjun Zhang.
Date Fri, 10 Oct 2014 01:53:22 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 ad47a27db -> 8cbacb37e
  refs/heads/trunk e532ed8fa -> cbd21fd13


HDFS-7026. Introduce a string constant for "Failed to obtain user group info...". Contributed
by Yongjun Zhang.


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

Branch: refs/heads/trunk
Commit: cbd21fd13b321d042faeff00fa71c9becc0d6087
Parents: e532ed8
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:52:48 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/cbd21fd1/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/cbd21fd1/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 475d865..4757784 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -376,6 +376,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/cbd21fd1/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 40312ec..1c3c802 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
@@ -354,7 +354,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/cbd21fd1/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/cbd21fd1/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