Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
935b2f3
Upgrade Jersey to 2.28 in hadoop-common
aajisaka Mar 26, 2019
dd630bb
KMS change. Fixed TestKMS except DelegationToken
aajisaka Mar 27, 2019
d58833a
Fixed delegation token related error.
aajisaka Mar 27, 2019
b309c5d
WIP. hadoop-hdfs migration
aajisaka Apr 1, 2019
2cc067f
Add back license header. Bump Jersey2 to 2.29.
aajisaka Aug 20, 2019
8d115b3
ParamFilter should implement javax.servlet.Filter in Jersey2.x
aajisaka Oct 8, 2019
4303d11
Fixed compile error in httpfs, the httpfs tests are now failing.
aajisaka Oct 8, 2019
21ba39f
Fix web.xml. Fix empty path annotation warnings.
aajisaka Oct 8, 2019
3581f67
Fixed WebHDFS tests
aajisaka Oct 9, 2019
d98f974
Fixed checkstyle warnings
aajisaka Oct 9, 2019
26d5e11
Test patch for httpfs
aajisaka Oct 9, 2019
4774fff
Workaround missing null check in Jersey 2.
aajisaka Oct 9, 2019
8ca9c5b
Fix findbugs and checkstyle warnings.
aajisaka Oct 10, 2019
3f49597
Make jersey-hk2 scope from compile to runtime.
aajisaka Oct 11, 2019
773b10c
Updated pom to compile hdfs-rbf successfully.
aajisaka Oct 11, 2019
a13b751
WIP. Migrating yarn-common.
aajisaka Oct 11, 2019
125d4c5
Use failsafe to retry instead of Jersey1 clientfilter
aajisaka Nov 14, 2019
855a328
Fixed tests to compile
aajisaka Nov 14, 2019
f47b0dc
WIP. Fix yarn
aajisaka Nov 15, 2019
cf72f20
Fix findbugs warnings in KMS.java
aajisaka Nov 15, 2019
2bc3d28
Fix compile errors in hadoop-yarn-common. Many tests are failing
aajisaka Nov 15, 2019
2d71bec
WIP. Use container v3 api
aajisaka Nov 19, 2019
4a57190
Fix compile error in HttpFSServer
aajisaka Dec 9, 2020
27807ac
Fix compile error in TimelineConnector and TimelineV2ClientImpl
aajisaka Dec 9, 2020
2ec6579
wip. Fixing compile error
aajisaka Dec 9, 2020
3cc7b42
Remove jersey from hdfs-nfs
aajisaka Dec 9, 2020
8191e51
Remove jersey1 setting from log4j.properties
aajisaka Dec 9, 2020
8d8550b
Fixed compile error in yarn-common
aajisaka Dec 9, 2020
9e94e92
Revert "WIP. Use container v3 api"
aajisaka Dec 9, 2020
7821526
Fix TestWebApp except testCustomRoutes
aajisaka Dec 9, 2020
cf62581
Fixed TestTimelineClient except testCheckRetryCount
aajisaka Dec 10, 2020
688b849
Add retry policy for TimelineWriter
aajisaka Dec 10, 2020
282bfa8
Fixed TestTimelineClient#testCheckRetryCount
aajisaka Dec 10, 2020
e061b26
Fix compile errors and unit tests in hadoop-yarn-server-common module
aajisaka Dec 10, 2020
518c965
Fix unused import
aajisaka Dec 10, 2020
172e2b2
wip commit. Fixing compile errors in hadoop-yarn-server-nodemanager
aajisaka Dec 10, 2020
34cb121
Fix findbugs warnings in WeightPolicyInfo.java
aajisaka Dec 11, 2020
07a2aca
Fixed compile error in hadoop-yarn-server-nodemanager
aajisaka Dec 11, 2020
a3a4b71
WIP. Trying fixing TestNMWebServices.java
aajisaka Dec 11, 2020
110ed68
Fix testWebHdfsPathWithSemicolon.
aajisaka Dec 15, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions hadoop-common-project/hadoop-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,35 +133,34 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-servlet</artifactId>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<!-- Used, even though 'mvn dependency:analyze' doesn't find it -->
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-json</artifactId>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>compile</scope>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import org.apache.hadoop.thirdparty.com.google.common.base.Preconditions;
import org.apache.hadoop.thirdparty.com.google.common.collect.ImmutableMap;
import org.apache.hadoop.thirdparty.com.google.common.collect.Lists;
import com.sun.jersey.spi.container.servlet.ServletContainer;
import org.apache.hadoop.HadoopIllegalArgumentException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.classification.InterfaceStability;
Expand Down Expand Up @@ -105,6 +104,8 @@
import org.eclipse.jetty.util.ssl.SslContextFactory;
import org.eclipse.jetty.util.thread.QueuedThreadPool;
import org.eclipse.jetty.webapp.WebAppContext;
import org.glassfish.jersey.server.ResourceConfig;
import org.glassfish.jersey.servlet.ServletContainer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -885,10 +886,24 @@ 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);
final ResourceConfig config = new ResourceConfig().packages(packageName);
final ServletHolder sh = new ServletHolder(new ServletContainer(config));
for (Map.Entry<String, String> entry : params.entrySet()) {
sh.setInitParameter(entry.getKey(), entry.getValue());
}
webAppContext.addServlet(sh, pathSpec);
}

/**
* Add a Jersey resource config.
* @param config The Jersey ResourceConfig to be registered.
* @param pathSpec The path spec for the servlet
* @param params properties and features for ResourceConfig
*/
public void addJerseyResourceConfig(final ResourceConfig config,
final String pathSpec, Map<String, String> params) {
LOG.info("addJerseryResourceConfig: pathSpec={}", pathSpec);
final ServletHolder sh = new ServletHolder(new ServletContainer(config));
for (Map.Entry<String, String> entry : params.entrySet()) {
sh.setInitParameter(entry.getKey(), entry.getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class DNS {
* @return The host name associated with the provided IP
* @throws NamingException If a NamingException is encountered
*/
public static String reverseDns(InetAddress hostIp, @Nullable String ns)
public static String reverseDns(InetAddress hostIp, String ns)
throws NamingException {
//
// Builds the reverse IP lookup form
Expand Down Expand Up @@ -241,7 +241,7 @@ public static String getDefaultIP(String strInterface)
* @throws UnknownHostException if the given interface is invalid
*/
public static String[] getHosts(String strInterface,
@Nullable String nameserver,
String nameserver,
boolean tryfallbackResolution)
throws UnknownHostException {
final List<String> hosts = new Vector<String>();
Expand Down Expand Up @@ -350,8 +350,8 @@ public static String[] getHosts(String strInterface)
* @throws UnknownHostException
* If one is encountered while querying the default interface
*/
public static String getDefaultHost(@Nullable String strInterface,
@Nullable String nameserver,
public static String getDefaultHost(String strInterface,
String nameserver,
boolean tryfallbackResolution)
throws UnknownHostException {
if (strInterface == null || "default".equals(strInterface)) {
Expand All @@ -378,7 +378,7 @@ public static String getDefaultHost(@Nullable String strInterface,
* @throws UnknownHostException
* If one is encountered while querying the default interface
*/
public static String getDefaultHost(@Nullable String strInterface)
public static String getDefaultHost(String strInterface)
throws UnknownHostException {
return getDefaultHost(strInterface, null, false);
}
Expand All @@ -394,8 +394,8 @@ public static String getDefaultHost(@Nullable String strInterface)
* @throws UnknownHostException
* If one is encountered while querying the default interface
*/
public static String getDefaultHost(@Nullable String strInterface,
@Nullable String nameserver)
public static String getDefaultHost(String strInterface,
String nameserver)
throws UnknownHostException {
return getDefaultHost(strInterface, nameserver, false);
}
Expand Down
21 changes: 18 additions & 3 deletions hadoop-common-project/hadoop-kms/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,30 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet-core</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.inject</groupId>
<artifactId>jersey-hk2</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ log4j.additivity.kms-audit=false

log4j.rootLogger=INFO, kms
log4j.logger.org.apache.hadoop=INFO
log4j.logger.com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator=OFF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to HADOOP-15686. If I get HADOOP-15686 in, we'll have to update here.

# make zookeeper log level an explicit config, and not changing with rootLogger.
log4j.logger.org.apache.zookeeper=INFO
log4j.logger.org.apache.curator=INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javax.ws.rs.DELETE;
import javax.ws.rs.DefaultValue;
import javax.ws.rs.GET;
import javax.ws.rs.OPTIONS;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
Expand Down Expand Up @@ -114,6 +115,14 @@ private static URI getKeyURI(String domain, String keyName) {
.build(domain, KMSRESTConstants.KEY_RESOURCE, keyName);
}

@OPTIONS
public Response handleOptions() {
return Response.ok()
.header("Allow", "GET")
.header("Allow", "OPTIONS")
.build();
}

@POST
@Path(KMSRESTConstants.KEYS_RESOURCE)
@Consumes(MediaType.APPLICATION_JSON)
Expand Down Expand Up @@ -175,13 +184,9 @@ public KeyVersion run() throws Exception {
keyVersion = removeKeyMaterial(keyVersion);
}
Map json = KMSUtil.toJSON(keyVersion);
String requestURL = KMSMDCFilter.getURL();
int idx = requestURL.lastIndexOf(KMSRESTConstants.KEYS_RESOURCE);
requestURL = requestURL.substring(0, idx);
LOG.trace("Exiting createKey Method.");
return Response.created(getKeyURI(KMSRESTConstants.SERVICE_VERSION, name))
.type(MediaType.APPLICATION_JSON)
.header("Location", getKeyURI(requestURL, name)).entity(json).build();
.type(MediaType.APPLICATION_JSON).entity(json).build();
} catch (Exception e) {
LOG.debug("Exception in createKey.", e);
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@

import org.apache.hadoop.classification.InterfaceAudience;

import com.sun.jersey.api.container.ContainerException;

import org.apache.hadoop.security.AccessControlException;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.security.authentication.client.AuthenticationException;
import org.apache.hadoop.security.authorize.AuthorizationException;
import org.apache.hadoop.util.HttpExceptionUtils;
import org.glassfish.jersey.server.ContainerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,11 @@

<servlet>
<servlet-name>webservices-driver</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>org.apache.hadoop.crypto.key.kms.server</param-value>
</init-param>

<!-- Enables detailed Jersey request/response logging -->
<!--
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
-->
<load-on-startup>1</load-on-startup>
</servlet>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %-5p %c{1} - %m%n
log4j.rootLogger=INFO, stdout
log4j.logger.org.apache.hadoop.conf=ERROR
log4j.logger.org.apache.hadoop.crytpo.key.kms.server=ALL
log4j.logger.com.sun.jersey.server.wadl.generators.WadlGeneratorJAXBGrammarGenerator=OFF
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: HADOOP-15686

log4j.logger.com.sun.jersey.server.wadl.generators.AbstractWadlGeneratorGrammarGenerator=OFF
log4j.logger.org.apache.hadoop.security=OFF
log4j.logger.org.apache.directory.server.core=OFF
log4j.logger.org.apache.hadoop.util.NativeCodeLoader=OFF
Expand Down
6 changes: 3 additions & 3 deletions hadoop-hdfs-project/hadoop-hdfs-httpfs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<artifactId>jersey-core</artifactId>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-common</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.sun.jersey</groupId>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-server</artifactId>
<scope>compile</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package org.apache.hadoop.fs.http.server;

import com.sun.jersey.api.container.ContainerException;
import org.apache.hadoop.classification.InterfaceAudience;
import org.apache.hadoop.lib.service.FileSystemAccessException;
import org.apache.hadoop.lib.wsrs.ExceptionProvider;
import org.glassfish.jersey.server.ContainerException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@
import org.apache.hadoop.lib.wsrs.ShortParam;
import org.apache.hadoop.lib.wsrs.StringParam;
import org.apache.hadoop.util.StringUtils;
import javax.ws.rs.ext.Provider;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

/**
* HttpFS ParametersProvider.
*/
@Provider
@InterfaceAudience.Private
@SuppressWarnings("unchecked")
public class HttpFSParametersProvider extends ParametersProvider {
Expand Down Expand Up @@ -125,7 +123,7 @@ public class HttpFSParametersProvider extends ParametersProvider {
PARAMS_DEF.put(Operation.SATISFYSTORAGEPOLICY, new Class[] {});
}

public HttpFSParametersProvider() {
HttpFSParametersProvider() {
super(HttpFSFileSystem.OP_PARAM, HttpFSFileSystem.Operation.class,
PARAMS_DEF);
}
Expand Down
Loading