Skip to content

Commit e57d5c9

Browse files
committed
Merge remote-tracking branch 'upstream/trunk' into YARN-11015
2 parents c580a95 + d8ab842 commit e57d5c9

File tree

528 files changed

+15777
-43972
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

528 files changed

+15777
-43972
lines changed

BUILDING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Refer to dev-support/docker/Dockerfile):
5757

5858
* Open JDK 1.8
5959
$ sudo apt-get update
60-
$ sudo apt-get -y install java-8-openjdk
60+
$ sudo apt-get -y install openjdk-8-jdk
6161
* Maven
6262
$ sudo apt-get -y install maven
6363
* Native libraries

LICENSE-binary

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -328,20 +328,20 @@ org.codehaus.jackson:jackson-jaxrs:1.9.13
328328
org.codehaus.jackson:jackson-mapper-asl:1.9.13
329329
org.codehaus.jackson:jackson-xc:1.9.13
330330
org.codehaus.jettison:jettison:1.1
331-
org.eclipse.jetty:jetty-annotations:9.3.27.v20190418
332-
org.eclipse.jetty:jetty-http:9.3.27.v20190418
333-
org.eclipse.jetty:jetty-io:9.3.27.v20190418
334-
org.eclipse.jetty:jetty-jndi:9.3.27.v20190418
335-
org.eclipse.jetty:jetty-plus:9.3.27.v20190418
336-
org.eclipse.jetty:jetty-security:9.3.27.v20190418
337-
org.eclipse.jetty:jetty-server:9.3.27.v20190418
338-
org.eclipse.jetty:jetty-servlet:9.3.27.v20190418
339-
org.eclipse.jetty:jetty-util:9.3.27.v20190418
340-
org.eclipse.jetty:jetty-util-ajax:9.3.27.v20190418
341-
org.eclipse.jetty:jetty-webapp:9.3.27.v20190418
342-
org.eclipse.jetty:jetty-xml:9.3.27.v20190418
343-
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.3.27.v20190418
344-
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.3.27.v20190418
331+
org.eclipse.jetty:jetty-annotations:9.4.44.v20210927
332+
org.eclipse.jetty:jetty-http:9.4.44.v20210927
333+
org.eclipse.jetty:jetty-io:9.4.44.v20210927
334+
org.eclipse.jetty:jetty-jndi:9.4.44.v20210927
335+
org.eclipse.jetty:jetty-plus:9.4.44.v20210927
336+
org.eclipse.jetty:jetty-security:9.4.44.v20210927
337+
org.eclipse.jetty:jetty-server:9.4.44.v20210927
338+
org.eclipse.jetty:jetty-servlet:9.4.44.v20210927
339+
org.eclipse.jetty:jetty-util:9.4.44.v20210927
340+
org.eclipse.jetty:jetty-util-ajax:9.4.44.v20210927
341+
org.eclipse.jetty:jetty-webapp:9.4.44.v20210927
342+
org.eclipse.jetty:jetty-xml:9.4.44.v20210927
343+
org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.44.v20210927
344+
org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.44.v20210927
345345
org.ehcache:ehcache:3.3.1
346346
org.lz4:lz4-java:1.7.1
347347
org.objenesis:objenesis:2.6
@@ -404,7 +404,7 @@ hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dataTables.bootstrap.css
404404
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dataTables.bootstrap.js
405405
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dust-full-2.0.0.min.js
406406
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dust-helpers-1.1.1.min.js
407-
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery-3.5.1.min.js
407+
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery-3.6.0.min.js
408408
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery.dataTables.min.js
409409
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/moment.min.js
410410
hadoop-tools/hadoop-sls/src/main/html/js/thirdparty/bootstrap.min.js

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dataTables.bootstrap.css
245245
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dataTables.bootstrap.js
246246
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dust-full-2.0.0.min.js
247247
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/dust-helpers-1.1.1.min.js
248-
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery-3.5.1.min.js
248+
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery-3.6.0.min.js
249249
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/jquery.dataTables.min.js
250250
hadoop-hdfs-project/hadoop-hdfs/src/main/webapps/static/moment.min.js
251251
hadoop-tools/hadoop-sls/src/main/html/js/thirdparty/bootstrap.min.js

NOTICE-binary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ available from http://www.digip.org/jansson/.
6666

6767

6868
AWS SDK for Java
69-
Copyright 2010-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
69+
Copyright 2010-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
7070

7171
This product includes software developed by
7272
Amazon Technologies, Inc (http://www.amazon.com/).

hadoop-common-project/hadoop-common/pom.xml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,24 @@
147147
<groupId>com.sun.jersey</groupId>
148148
<artifactId>jersey-json</artifactId>
149149
<scope>compile</scope>
150+
<exclusions>
151+
<exclusion>
152+
<groupId>org.codehaus.jackson</groupId>
153+
<artifactId>jackson-core-asl</artifactId>
154+
</exclusion>
155+
<exclusion>
156+
<groupId>org.codehaus.jackson</groupId>
157+
<artifactId>jackson-mapper-asl</artifactId>
158+
</exclusion>
159+
<exclusion>
160+
<groupId>org.codehaus.jackson</groupId>
161+
<artifactId>jackson-jaxrs</artifactId>
162+
</exclusion>
163+
<exclusion>
164+
<groupId>org.codehaus.jackson</groupId>
165+
<artifactId>jackson-xc</artifactId>
166+
</exclusion>
167+
</exclusions>
150168
</dependency>
151169
<dependency>
152170
<groupId>com.sun.jersey</groupId>
@@ -915,7 +933,6 @@
915933
<groupId>org.apache.maven.plugins</groupId>
916934
<artifactId>maven-surefire-plugin</artifactId>
917935
<configuration>
918-
<testFailureIgnore>${ignoreTestFailure}</testFailureIgnore>
919936
<forkCount>${testsThreadCount}</forkCount>
920937
<reuseForks>false</reuseForks>
921938
<argLine>${maven-surefire-plugin.argLine} -DminiClusterDedicatedDirs=true</argLine>

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,11 +2978,13 @@ public Iterator<Map.Entry<String, String>> iterator() {
29782978
// methods that allow non-strings to be put into configurations are removed,
29792979
// we could replace properties with a Map<String,String> and get rid of this
29802980
// code.
2981-
Map<String,String> result = new HashMap<String,String>();
2982-
for(Map.Entry<Object,Object> item: getProps().entrySet()) {
2983-
if (item.getKey() instanceof String &&
2984-
item.getValue() instanceof String) {
2981+
Properties props = getProps();
2982+
Map<String, String> result = new HashMap<>();
2983+
synchronized (props) {
2984+
for (Map.Entry<Object, Object> item : props.entrySet()) {
2985+
if (item.getKey() instanceof String && item.getValue() instanceof String) {
29852986
result.put((String) item.getKey(), (String) item.getValue());
2987+
}
29862988
}
29872989
}
29882990
return result.entrySet().iterator();

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/crypto/OpensslCipher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ static int get(String padding) throws NoSuchPaddingException {
8484
String loadingFailure = null;
8585
try {
8686
if (!NativeCodeLoader.buildSupportsOpenssl()) {
87-
PerformanceAdvisory.LOG.debug("Build does not support openssl");
87+
PerformanceAdvisory.LOG.warn("Build does not support openssl");
8888
loadingFailure = "build does not support openssl.";
8989
} else {
9090
initIDs();
9191
}
9292
} catch (Throwable t) {
9393
loadingFailure = t.getMessage();
94-
LOG.debug("Failed to load OpenSSL Cipher.", t);
94+
LOG.warn("Failed to load OpenSSL Cipher.", t);
9595
} finally {
9696
loadingFailureReason = loadingFailure;
9797
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/CachingGetSpaceUsed.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ void init() {
8989
if (!shouldFirstRefresh) {
9090
// Skip initial refresh operation, so we need to do first refresh
9191
// operation immediately in refresh thread.
92-
initRefeshThread(true);
92+
initRefreshThread(true);
9393
return;
9494
}
9595
refresh();
9696
}
97-
initRefeshThread(false);
97+
initRefreshThread(false);
9898
}
9999

100100
/**
101101
* RunImmediately should set true, if we skip the first refresh.
102102
* @param runImmediately The param default should be false.
103103
*/
104-
private void initRefeshThread (boolean runImmediately) {
104+
private void initRefreshThread(boolean runImmediately) {
105105
if (refreshInterval > 0) {
106106
refreshUsed = new Thread(new RefreshThread(this, runImmediately),
107107
"refreshUsed-" + dirPath);

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.net.MalformedURLException;
2828
import java.net.URI;
2929
import java.net.URL;
30+
import java.nio.file.Files;
3031
import java.nio.file.Path;
3132
import java.nio.file.Paths;
3233
import java.util.List;
@@ -771,6 +772,28 @@ private void initializeWebServer(String name, String hostName,
771772

772773
addDefaultServlets();
773774
addPrometheusServlet(conf);
775+
addAsyncProfilerServlet(contexts, conf);
776+
}
777+
778+
private void addAsyncProfilerServlet(ContextHandlerCollection contexts, Configuration conf)
779+
throws IOException {
780+
final String asyncProfilerHome = ProfileServlet.getAsyncProfilerHome();
781+
if (asyncProfilerHome != null && !asyncProfilerHome.trim().isEmpty()) {
782+
addServlet("prof", "/prof", ProfileServlet.class);
783+
Path tmpDir = Paths.get(ProfileServlet.OUTPUT_DIR);
784+
if (Files.notExists(tmpDir)) {
785+
Files.createDirectories(tmpDir);
786+
}
787+
ServletContextHandler genCtx = new ServletContextHandler(contexts, "/prof-output-hadoop");
788+
genCtx.addServlet(ProfileOutputServlet.class, "/*");
789+
genCtx.setResourceBase(tmpDir.toAbsolutePath().toString());
790+
genCtx.setDisplayName("prof-output-hadoop");
791+
setContextAttributes(genCtx, conf);
792+
} else {
793+
addServlet("prof", "/prof", ProfilerDisabledServlet.class);
794+
LOG.info("ASYNC_PROFILER_HOME environment variable and async.profiler.home system property "
795+
+ "not specified. Disabling /prof endpoint.");
796+
}
774797
}
775798

776799
private void addPrometheusServlet(Configuration conf) {
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
package org.apache.hadoop.http;
20+
21+
import java.io.File;
22+
import java.io.IOException;
23+
import java.util.regex.Pattern;
24+
import javax.servlet.ServletException;
25+
import javax.servlet.http.HttpServletRequest;
26+
import javax.servlet.http.HttpServletResponse;
27+
28+
import org.eclipse.jetty.servlet.DefaultServlet;
29+
import org.slf4j.Logger;
30+
import org.slf4j.LoggerFactory;
31+
32+
import org.apache.hadoop.classification.InterfaceAudience;
33+
34+
/**
35+
* Servlet to serve files generated by {@link ProfileServlet}.
36+
*/
37+
@InterfaceAudience.Private
38+
public class ProfileOutputServlet extends DefaultServlet {
39+
40+
private static final long serialVersionUID = 1L;
41+
42+
private static final Logger LOG = LoggerFactory.getLogger(ProfileOutputServlet.class);
43+
// default refresh period 2 sec
44+
private static final int REFRESH_PERIOD = 2;
45+
// Alphanumeric characters, plus percent (url-encoding), equals, ampersand, dot and hyphen
46+
private static final Pattern ALPHA_NUMERIC = Pattern.compile("[a-zA-Z0-9%=&.\\-]*");
47+
48+
@Override
49+
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
50+
throws ServletException, IOException {
51+
if (!HttpServer2.isInstrumentationAccessAllowed(getServletContext(), req, resp)) {
52+
resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
53+
ProfileServlet.setResponseHeader(resp);
54+
resp.getWriter().write("Unauthorized: Instrumentation access is not allowed!");
55+
return;
56+
}
57+
58+
String absoluteDiskPath = getServletContext().getRealPath(req.getPathInfo());
59+
File requestedFile = new File(absoluteDiskPath);
60+
// async-profiler version 1.4 writes 'Started [cpu] profiling' to output file when profiler is
61+
// running which gets replaced by final output. If final output is not ready yet, the file size
62+
// will be <100 bytes (in all modes).
63+
if (requestedFile.length() < 100) {
64+
LOG.info("{} is incomplete. Sending auto-refresh header.", requestedFile);
65+
String refreshUrl = req.getRequestURI();
66+
// Rebuild the query string (if we have one)
67+
if (req.getQueryString() != null) {
68+
refreshUrl += "?" + sanitize(req.getQueryString());
69+
}
70+
ProfileServlet.setResponseHeader(resp);
71+
resp.setHeader("Refresh", REFRESH_PERIOD + ";" + refreshUrl);
72+
resp.getWriter().write("This page will be auto-refreshed every " + REFRESH_PERIOD
73+
+ " seconds until the output file is ready. Redirecting to " + refreshUrl);
74+
} else {
75+
super.doGet(req, resp);
76+
}
77+
}
78+
79+
static String sanitize(String input) {
80+
// Basic test to try to avoid any XSS attacks or HTML content showing up.
81+
// Duplicates HtmlQuoting a little, but avoid destroying ampersand.
82+
if (ALPHA_NUMERIC.matcher(input).matches()) {
83+
return input;
84+
}
85+
throw new RuntimeException("Non-alphanumeric data found in input, aborting.");
86+
}
87+
}

0 commit comments

Comments
 (0)