hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x...@apache.org
Subject [02/45] hadoop git commit: YARN-8108. Added option to disable loading existing filters to prevent security filter from initialize twice. Contributed by Sunil Govindan
Date Mon, 02 Jul 2018 20:32:19 GMT
YARN-8108.  Added option to disable loading existing filters to prevent
            security filter from initialize twice.
            Contributed by Sunil Govindan


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

Branch: refs/heads/HDDS-4
Commit: b69ba0f3307a90500aeb0c5db9e582fcda60b501
Parents: 3e58633
Author: Eric Yang <eyang@apache.org>
Authored: Tue Jun 26 17:34:57 2018 -0400
Committer: Eric Yang <eyang@apache.org>
Committed: Tue Jun 26 17:34:57 2018 -0400

----------------------------------------------------------------------
 .../java/org/apache/hadoop/yarn/webapp/WebApps.java   | 14 +++++++++++---
 .../yarn/server/resourcemanager/ResourceManager.java  |  2 +-
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/b69ba0f3/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java
index 0d045f3..0e9f0a7 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/java/org/apache/hadoop/yarn/webapp/WebApps.java
@@ -83,6 +83,7 @@ public class WebApps {
       public String name;
       public String spec;
       public Map<String, String> params;
+      public boolean loadExistingFilters = true;
     }
     
     final String name;
@@ -151,12 +152,13 @@ public class WebApps {
 
     public Builder<T> withServlet(String name, String pathSpec,
         Class<? extends HttpServlet> servlet,
-        Map<String, String> params) {
+        Map<String, String> params,boolean loadExistingFilters) {
       ServletStruct struct = new ServletStruct();
       struct.clazz = servlet;
       struct.name = name;
       struct.spec = pathSpec;
       struct.params = params;
+      struct.loadExistingFilters = loadExistingFilters;
       servlets.add(struct);
       return this;
     }
@@ -256,9 +258,15 @@ public class WebApps {
           pathList.add("/" + wsName + "/*");
         }
       }
+
       for (ServletStruct s : servlets) {
         if (!pathList.contains(s.spec)) {
-          pathList.add(s.spec);
+          // The servlet told us to not load-existing filters, but we still want
+          // to add the default authentication filter always, so add it to the
+          // pathList
+          if (!s.loadExistingFilters) {
+            pathList.add(s.spec);
+          }
         }
       }
       if (conf == null) {
@@ -333,7 +341,7 @@ public class WebApps {
         HttpServer2 server = builder.build();
 
         for(ServletStruct struct: servlets) {
-          if (struct.params != null) {
+          if (!struct.loadExistingFilters) {
             server.addInternalServlet(struct.name, struct.spec,
                 struct.clazz, struct.params);
           } else {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/b69ba0f3/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
----------------------------------------------------------------------
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
index c533111..0b7e87c 100644
--- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
+++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/ResourceManager.java
@@ -1111,7 +1111,7 @@ public class ResourceManager extends CompositeService implements Recoverable
{
                 "ws")
             .with(conf)
             .withServlet("API-Service", "/app/*",
-                ServletContainer.class, params)
+                ServletContainer.class, params, false)
             .withHttpSpnegoPrincipalKey(
                 YarnConfiguration.RM_WEBAPP_SPNEGO_USER_NAME_KEY)
             .withHttpSpnegoKeytabKey(


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message