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 2016/04/25 21:08:34 UTC

[1/4] storm git commit: STORM-1535: Make sure hdfs key tab login happens only once for multiple bolts/executors.

Repository: storm
Updated Branches:
  refs/heads/master 4e3c5bd54 -> 4ea884071


STORM-1535: Make sure hdfs key tab login happens only once for multiple bolts/executors.


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

Branch: refs/heads/master
Commit: bc488c23420215db847fd8dde5a1006e319521de
Parents: 1a09da5
Author: Priyank <ps...@hortonworks.com>
Authored: Thu Mar 31 12:46:25 2016 -0700
Committer: Priyank <ps...@hortonworks.com>
Committed: Wed Apr 20 18:19:41 2016 -0700

----------------------------------------------------------------------
 .../hdfs/common/security/HdfsSecurityUtil.java  | 25 ++++++++++++--------
 1 file changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/bc488c23/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
----------------------------------------------------------------------
diff --git a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
index 993214a..d2f6273 100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
@@ -28,6 +28,7 @@ import org.slf4j.LoggerFactory;
 import java.io.IOException;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.atomic.AtomicBoolean;
 
 import static org.apache.storm.Config.TOPOLOGY_AUTO_CREDENTIALS;
 
@@ -40,23 +41,27 @@ public class HdfsSecurityUtil {
     public static final String STORM_USER_NAME_KEY = "hdfs.kerberos.principal";
 
     private static final Logger LOG = LoggerFactory.getLogger(HdfsSecurityUtil.class);
-
+    private static AtomicBoolean isLoggedIn = new AtomicBoolean();
     public static void login(Map conf, Configuration hdfsConfig) throws IOException {
         //If AutoHDFS is specified, do not attempt to login using keytabs, only kept for backward compatibility.
         if(conf.get(TOPOLOGY_AUTO_CREDENTIALS) == null ||
                 (!(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoHDFS.class.getName())) &&
                  !(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoTGT.class.getName())))) {
             if (UserGroupInformation.isSecurityEnabled()) {
-                LOG.info("Logging in using keytab as AutoHDFS is not specified for " + TOPOLOGY_AUTO_CREDENTIALS);
-                String keytab = (String) conf.get(STORM_KEYTAB_FILE_KEY);
-                if (keytab != null) {
-                    hdfsConfig.set(STORM_KEYTAB_FILE_KEY, keytab);
-                }
-                String userName = (String) conf.get(STORM_USER_NAME_KEY);
-                if (userName != null) {
-                    hdfsConfig.set(STORM_USER_NAME_KEY, userName);
+                // compareAndSet added because of https://issues.apache.org/jira/browse/STORM-1535
+                // need to test it first during ERIE release testing since the JIRA says "might" be and port it to apache.
+                if (isLoggedIn.compareAndSet(false, true)) {
+                    LOG.info("Logging in using keytab as AutoHDFS is not specified for " + TOPOLOGY_AUTO_CREDENTIALS);
+                    String keytab = (String) conf.get(STORM_KEYTAB_FILE_KEY);
+                    if (keytab != null) {
+                        hdfsConfig.set(STORM_KEYTAB_FILE_KEY, keytab);
+                    }
+                    String userName = (String) conf.get(STORM_USER_NAME_KEY);
+                    if (userName != null) {
+                        hdfsConfig.set(STORM_USER_NAME_KEY, userName);
+                    }
+                    SecurityUtil.login(hdfsConfig, STORM_KEYTAB_FILE_KEY, STORM_USER_NAME_KEY);
                 }
-                SecurityUtil.login(hdfsConfig, STORM_KEYTAB_FILE_KEY, STORM_USER_NAME_KEY);
             }
         }
     }


[2/4] storm git commit: STORM-1535: Removing the unnecessary comment.

Posted by pt...@apache.org.
STORM-1535: Removing the unnecessary comment.


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

Branch: refs/heads/master
Commit: 87b0f3c895f54b87e0265f7f28984e0e3f310b58
Parents: bc488c2
Author: Priyank <ps...@hortonworks.com>
Authored: Thu Apr 21 10:10:26 2016 -0700
Committer: Priyank <ps...@hortonworks.com>
Committed: Thu Apr 21 10:10:26 2016 -0700

----------------------------------------------------------------------
 .../org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java     | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/87b0f3c8/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
----------------------------------------------------------------------
diff --git a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
index d2f6273..f380b38 100644
--- a/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
+++ b/external/storm-hdfs/src/main/java/org/apache/storm/hdfs/common/security/HdfsSecurityUtil.java
@@ -49,7 +49,6 @@ public class HdfsSecurityUtil {
                  !(((List)conf.get(TOPOLOGY_AUTO_CREDENTIALS)).contains(AutoTGT.class.getName())))) {
             if (UserGroupInformation.isSecurityEnabled()) {
                 // compareAndSet added because of https://issues.apache.org/jira/browse/STORM-1535
-                // need to test it first during ERIE release testing since the JIRA says "might" be and port it to apache.
                 if (isLoggedIn.compareAndSet(false, true)) {
                     LOG.info("Logging in using keytab as AutoHDFS is not specified for " + TOPOLOGY_AUTO_CREDENTIALS);
                     String keytab = (String) conf.get(STORM_KEYTAB_FILE_KEY);


[4/4] storm git commit: add STORM-1535 to changelog

Posted by pt...@apache.org.
add STORM-1535 to changelog


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

Branch: refs/heads/master
Commit: 4ea88407199af25282b84dbeed972659d62f161b
Parents: a3c0d5d
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 25 15:08:25 2016 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Mon Apr 25 15:08:25 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/4ea88407/CHANGELOG.md
----------------------------------------------------------------------
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9420e54..c2ab151 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
 ## 2.0.0
+ * STORM-1535: Make sure hdfs key tab login happens only once for multiple components
  * STORM-1544: Document Debug/Sampling of Topologies
  * STORM-1681: Bug in scheduling cyclic topologies when scheduling with RAS
  * STORM-1679: add storm Scheduler documents


[3/4] storm git commit: Merge branch 'STORM-1535' of github.com:priyank5485/storm

Posted by pt...@apache.org.
Merge branch 'STORM-1535' of github.com:priyank5485/storm


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

Branch: refs/heads/master
Commit: a3c0d5d99a4e2882e7647c97cd0919279bf0bf65
Parents: 4e3c5bd 87b0f3c
Author: P. Taylor Goetz <pt...@gmail.com>
Authored: Mon Apr 25 15:07:03 2016 -0400
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Mon Apr 25 15:07:03 2016 -0400

----------------------------------------------------------------------
 .../hdfs/common/security/HdfsSecurityUtil.java  | 24 ++++++++++++--------
 1 file changed, 14 insertions(+), 10 deletions(-)
----------------------------------------------------------------------