You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2017/06/01 20:27:55 UTC

[20/50] storm git commit: STORM-2520 AutoHDFS should prefer cluster-wise hdfs kerberos principal to global hdfs kerberos principal

STORM-2520 AutoHDFS should prefer cluster-wise hdfs kerberos principal to global hdfs kerberos principal


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

Branch: refs/heads/metrics_v2
Commit: 7a749a1051d77e5b267c0801e83f169961ee90d1
Parents: 4058623
Author: Jungtaek Lim <ka...@gmail.com>
Authored: Wed May 17 23:45:42 2017 +0900
Committer: Jungtaek Lim <ka...@gmail.com>
Committed: Wed May 17 23:45:42 2017 +0900

----------------------------------------------------------------------
 .../src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/7a749a10/external/storm-autocreds/src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java
----------------------------------------------------------------------
diff --git a/external/storm-autocreds/src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java b/external/storm-autocreds/src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java
index e1e8512..bd7ea0a 100644
--- a/external/storm-autocreds/src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java
+++ b/external/storm-autocreds/src/main/java/org/apache/storm/hdfs/security/AutoHDFS.java
@@ -117,7 +117,11 @@ public class AutoHDFS extends AbstractAutoCreds {
                             FileSystem fileSystem = FileSystem.get(nameNodeURI, configuration);
                             Credentials credential= proxyUser.getCredentials();
 
-                            fileSystem.addDelegationTokens(hdfsPrincipal, credential);
+                            if (configuration.get(STORM_USER_NAME_KEY) == null) {
+                                configuration.set(STORM_USER_NAME_KEY, hdfsPrincipal);
+                            }
+
+                            fileSystem.addDelegationTokens(configuration.get(STORM_USER_NAME_KEY), credential);
                             LOG.info("Delegation tokens acquired for user {}", topologySubmitterUser);
                             return credential;
                         } catch (IOException e) {