hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject hadoop git commit: HDFS-9085. Show renewer information in DelegationTokenIdentifier#toString. Contributed by Zhihai Xu.
Date Fri, 09 Oct 2015 21:29:57 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk c32614f41 -> 4f6e842ba


HDFS-9085. Show renewer information in DelegationTokenIdentifier#toString. Contributed by
Zhihai Xu.


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

Branch: refs/heads/trunk
Commit: 4f6e842ba936f4a068168b518eea80bb6dd02d85
Parents: c32614f
Author: cnauroth <cnauroth@apache.org>
Authored: Fri Oct 9 14:27:13 2015 -0700
Committer: cnauroth <cnauroth@apache.org>
Committed: Fri Oct 9 14:27:13 2015 -0700

----------------------------------------------------------------------
 .../token/delegation/DelegationTokenIdentifier.java         | 3 ++-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                 | 3 +++
 .../apache/hadoop/hdfs/security/TestDelegationToken.java    | 9 +++++++++
 3 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4f6e842b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java
b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java
index 4544b0e..62d5b9b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java
+++ b/hadoop-hdfs-project/hadoop-hdfs-client/src/main/java/org/apache/hadoop/hdfs/security/token/delegation/DelegationTokenIdentifier.java
@@ -61,7 +61,8 @@ public class DelegationTokenIdentifier
   @Override
   public String toString() {
     return getKind() + " token " + getSequenceNumber()
-        + " for " + getUser().getShortUserName();
+        + " for " + getUser().getShortUserName() + " with renewer " +
+        getRenewer();
   }
 
   /** @return a string representation of the token */

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4f6e842b/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 9d73776..6dc949b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -39,6 +39,9 @@ Trunk (Unreleased)
     HDFS-8981. Adding revision to data node jmx getVersion() method. (Siqi Li
     via mingma)
 
+    HDFS-9085. Show renewer information in DelegationTokenIdentifier#toString.
+    (Zhihai Xu via cnauroth)
+
   NEW FEATURES
 
     HDFS-3125. Add JournalService to enable Journal Daemon. (suresh)

http://git-wip-us.apache.org/repos/asf/hadoop/blob/4f6e842b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/security/TestDelegationToken.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/security/TestDelegationToken.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/security/TestDelegationToken.java
index 35f31be..35c653d 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/security/TestDelegationToken.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/security/TestDelegationToken.java
@@ -314,4 +314,13 @@ public class TestDelegationToken {
           }
         });
   }
+
+  @Test
+  public void testDelegationTokenIdentifierToString() throws Exception {
+    DelegationTokenIdentifier dtId = new DelegationTokenIdentifier(new Text(
+        "SomeUser"), new Text("JobTracker"), null);
+    Assert.assertEquals("HDFS_DELEGATION_TOKEN token 0" +
+        " for SomeUser with renewer JobTracker",
+        dtId.toString());
+  }
 }


Mime
View raw message