knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kris...@apache.org
Subject [knox] 18/20: KNOX-2046 - Upgrade hadoop to 3.2.1
Date Fri, 27 Sep 2019 22:00:25 GMT
This is an automated email from the ASF dual-hosted git repository.

krisden pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git

commit 39880dacbbf3933a989574695e6403c743a609b1
Author: Kevin Risden <krisden@apache.org>
AuthorDate: Fri Sep 27 16:10:44 2019 -0500

    KNOX-2046 - Upgrade hadoop to 3.2.1
    
    Signed-off-by: Kevin Risden <krisden@apache.org>
---
 .../java/org/apache/hadoop/http/HttpServer2.java   | 77 +++++++++++++---------
 .../java/org/apache/hadoop/http/HttpServer2.java   | 14 ++++
 pom.xml                                            |  2 +-
 3 files changed, 60 insertions(+), 33 deletions(-)

diff --git a/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
b/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
index ef148fe..0b3daee 100644
--- a/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
+++ b/gateway-test-release/webhdfs-kerb-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
@@ -17,38 +17,6 @@
  */
 package org.apache.hadoop.http;
 
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.io.PrintStream;
-import java.net.BindException;
-import java.net.InetSocketAddress;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponse;
-
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ImmutableMap;
 import com.google.common.collect.Lists;
@@ -103,6 +71,37 @@ import org.eclipse.jetty.webapp.WebAppContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InterruptedIOException;
+import java.io.PrintStream;
+import java.net.BindException;
+import java.net.InetSocketAddress;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 /**
  * Create a Jetty embedded server to answer http requests. The primary goal is
  * to serve up status information for the server. There are three contexts:
@@ -781,12 +780,26 @@ public final class HttpServer2 implements FilterContainer {
    */
   public void addJerseyResourcePackage(final String packageName,
                                        final String pathSpec) {
+    addJerseyResourcePackage(packageName, pathSpec, Collections.emptyMap());
+  }
+
+  /**
+   * Add a Jersey resource package.
+   * @param packageName The Java package name containing the Jersey resource.
+   * @param pathSpec The path spec for the servlet
+   * @param params properties and features for ResourceConfig
+   */
+  public void addJerseyResourcePackage(final String packageName,
+                                       final String pathSpec, Map<String, String> params)
{
     LOG.info("addJerseyResourcePackage: packageName=" + packageName
                  + ", pathSpec=" + pathSpec);
     final ServletHolder sh = new ServletHolder(ServletContainer.class);
     sh.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
         "com.sun.jersey.api.core.PackagesResourceConfig");
     sh.setInitParameter("com.sun.jersey.config.property.packages", packageName);
+    for (Map.Entry<String, String> entry : params.entrySet()) {
+      sh.setInitParameter(entry.getKey(), entry.getValue());
+    }
     webAppContext.addServlet(sh, pathSpec);
   }
 
diff --git a/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
b/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
index ef148fe..dcc08b4 100644
--- a/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
+++ b/gateway-test-release/webhdfs-test/src/test/java/org/apache/hadoop/http/HttpServer2.java
@@ -781,12 +781,26 @@ public final class HttpServer2 implements FilterContainer {
    */
   public void addJerseyResourcePackage(final String packageName,
                                        final String pathSpec) {
+    addJerseyResourcePackage(packageName, pathSpec, Collections.emptyMap());
+  }
+
+  /**
+   * Add a Jersey resource package.
+   * @param packageName The Java package name containing the Jersey resource.
+   * @param pathSpec The path spec for the servlet
+   * @param params properties and features for ResourceConfig
+   */
+  public void addJerseyResourcePackage(final String packageName,
+                                       final String pathSpec, Map<String, String> params)
{
     LOG.info("addJerseyResourcePackage: packageName=" + packageName
                  + ", pathSpec=" + pathSpec);
     final ServletHolder sh = new ServletHolder(ServletContainer.class);
     sh.setInitParameter("com.sun.jersey.config.property.resourceConfigClass",
         "com.sun.jersey.api.core.PackagesResourceConfig");
     sh.setInitParameter("com.sun.jersey.config.property.packages", packageName);
+    for (Map.Entry<String, String> entry : params.entrySet()) {
+      sh.setInitParameter(entry.getKey(), entry.getValue());
+    }
     webAppContext.addServlet(sh, pathSpec);
   }
 
diff --git a/pom.xml b/pom.xml
index a320ed7..afda2fe 100644
--- a/pom.xml
+++ b/pom.xml
@@ -179,7 +179,7 @@
         <forbiddenapis.version>2.6</forbiddenapis.version>
         <groovy.version>2.5.8</groovy.version>
         <guava.version>28.1-jre</guava.version>
-        <hadoop.version>3.2.0</hadoop.version>
+        <hadoop.version>3.2.1</hadoop.version>
         <hamcrest.version>2.1</hamcrest.version>
         <hamcrest-json.version>0.2</hamcrest-json.version>
         <httpclient.version>4.5.6</httpclient.version>


Mime
View raw message