Skip to content

Commit c5652a0

Browse files
committed
Merge branch 'trunk' of github.com:apache/hadoop into HADOOP-19072-trunk
2 parents e7ef0d8 + 59d5e0b commit c5652a0

File tree

12 files changed

+110
-19
lines changed

12 files changed

+110
-19
lines changed

LICENSE-binary

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ hadoop-hdfs-project/hadoop-hdfs-native-client/src/main/native/fuse-dfs/util/tree
379379
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager/src/main/native/container-executor/impl/compat/{fstatat|openat|unlinkat}.h
380380

381381
com.github.luben:zstd-jni:1.5.2-1
382-
dnsjava:dnsjava:2.1.7
382+
dnsjava:dnsjava:3.6.1
383383
org.codehaus.woodstox:stax2-api:4.2.1
384384

385385

dev-support/docker/pkg-resolver/install-yasm.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fi
4040

4141
if [ "$version_to_install" == "1.2.0-4" ]; then
4242
mkdir -p /tmp/yasm &&
43-
curl -L -s -S https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/y/yasm-1.2.0-4.el7.x86_64.rpm \
43+
curl -L -s -S https://archives.fedoraproject.org/pub/archive/epel/7/x86_64/Packages/y/yasm-1.2.0-4.el7.x86_64.rpm \
4444
-o /tmp/yasm-1.2.0-4.el7.x86_64.rpm &&
4545
rpm -Uvh /tmp/yasm-1.2.0-4.el7.x86_64.rpm
4646
else

hadoop-client-modules/hadoop-client-check-invariants/src/test/resources/ensure-jars-have-correct-contents.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ allowed_expr+="|^[^-]*-default.xml$"
5151
allowed_expr+="|^[^-]*-version-info.properties$"
5252
# * Hadoop's application classloader properties file.
5353
allowed_expr+="|^org.apache.hadoop.application-classloader.properties$"
54+
# Comes from dnsjava, not sure if relocatable.
55+
allowed_expr+="|^messages.properties$"
5456
# public suffix list used by httpcomponents
5557
allowed_expr+="|^mozilla/$"
5658
allowed_expr+="|^mozilla/public-suffix-list.txt$"

hadoop-client-modules/hadoop-client-runtime/pom.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@
229229
<exclude>jnamed*</exclude>
230230
<exclude>lookup*</exclude>
231231
<exclude>update*</exclude>
232+
<exclude>META-INF/versions/21/*</exclude>
233+
<exclude>META-INF/versions/21/**/*</exclude>
232234
</excludes>
233235
</filter>
234236
<filter>
@@ -243,6 +245,7 @@
243245
<excludes>
244246
<exclude>META-INF/versions/9/module-info.class</exclude>
245247
<exclude>META-INF/versions/11/module-info.class</exclude>
248+
<exclude>META-INF/versions/21/module-info.class</exclude>
246249
</excludes>
247250
</filter>
248251

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,17 @@
708708
</filesets>
709709
</configuration>
710710
</plugin>
711+
712+
<plugin>
713+
<groupId>org.apache.maven.plugins</groupId>
714+
<artifactId>maven-javadoc-plugin</artifactId>
715+
<configuration>
716+
<sourceFileExcludes>
717+
<sourceFileExclude>**/FSProtos.java</sourceFileExclude>
718+
</sourceFileExcludes>
719+
<excludePackageNames>*.proto:*.tracing:*.protobuf</excludePackageNames>
720+
</configuration>
721+
</plugin>
711722
</plugins>
712723
</build>
713724

@@ -1279,16 +1290,6 @@
12791290
</execution>
12801291
</executions>
12811292
</plugin>
1282-
<plugin>
1283-
<groupId>org.apache.maven.plugins</groupId>
1284-
<artifactId>maven-javadoc-plugin</artifactId>
1285-
<configuration>
1286-
<sourceFileExcludes>
1287-
<sourceFileExclude>**/FSProtos.java</sourceFileExclude>
1288-
</sourceFileExcludes>
1289-
<excludePackageNames>*.proto:*.tracing:*.protobuf</excludePackageNames>
1290-
</configuration>
1291-
</plugin>
12921293
</plugins>
12931294
</build>
12941295
</profile>

hadoop-common-project/hadoop-registry/src/main/java/org/apache/hadoop/registry/server/dns/RegistryDNS.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ public void exec(Zone zone, Record record) throws IOException {
16821682
DNSSEC.sign(rRset, dnskeyRecord, privateKey,
16831683
inception, expiration);
16841684
LOG.info("Adding {}", rrsigRecord);
1685-
rRset.addRR(rrsigRecord);
1685+
zone.addRecord(rrsigRecord);
16861686

16871687
//addDSRecord(zone, record.getName(), record.getDClass(),
16881688
// record.getTTL(), inception, expiration);

hadoop-common-project/hadoop-registry/src/test/java/org/apache/hadoop/registry/server/dns/TestRegistryDNS.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public void testMissingReverseLookup() throws Exception {
350350
Name name = Name.fromString("19.1.17.172.in-addr.arpa.");
351351
Record question = Record.newRecord(name, Type.PTR, DClass.IN);
352352
Message query = Message.newQuery(question);
353-
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO, null);
353+
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO);
354354
query.addRecord(optRecord, Section.ADDITIONAL);
355355
byte[] responseBytes = getRegistryDNS().generateReply(query, null);
356356
Message response = new Message(responseBytes);
@@ -392,7 +392,7 @@ private List<Record> assertDNSQuery(String lookup, int type, int numRecs)
392392
Name name = Name.fromString(lookup);
393393
Record question = Record.newRecord(name, type, DClass.IN);
394394
Message query = Message.newQuery(question);
395-
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO, null);
395+
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO);
396396
query.addRecord(optRecord, Section.ADDITIONAL);
397397
byte[] responseBytes = getRegistryDNS().generateReply(query, null);
398398
Message response = new Message(responseBytes);
@@ -421,7 +421,7 @@ private List<Record> assertDNSQueryNotNull(
421421
Name name = Name.fromString(lookup);
422422
Record question = Record.newRecord(name, type, DClass.IN);
423423
Message query = Message.newQuery(question);
424-
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO, null);
424+
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO);
425425
query.addRecord(optRecord, Section.ADDITIONAL);
426426
byte[] responseBytes = getRegistryDNS().generateReply(query, null);
427427
Message response = new Message(responseBytes);
@@ -592,7 +592,7 @@ public void testReadMasterFile() throws Exception {
592592
Name name = Name.fromString("5.0.17.172.in-addr.arpa.");
593593
Record question = Record.newRecord(name, Type.PTR, DClass.IN);
594594
Message query = Message.newQuery(question);
595-
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO, null);
595+
OPTRecord optRecord = new OPTRecord(4096, 0, 0, Flags.DO);
596596
query.addRecord(optRecord, Section.ADDITIONAL);
597597
byte[] responseBytes = getRegistryDNS().generateReply(query, null);
598598
Message response = new Message(responseBytes);

hadoop-hdfs-project/hadoop-hdfs-rbf/src/main/java/org/apache/hadoop/hdfs/server/federation/router/RouterHttpServer.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.net.InetSocketAddress;
2121

2222
import org.apache.hadoop.conf.Configuration;
23+
import org.apache.hadoop.hdfs.DFSConfigKeys;
2324
import org.apache.hadoop.hdfs.DFSUtil;
2425
import org.apache.hadoop.hdfs.server.common.JspHelper;
2526
import org.apache.hadoop.hdfs.server.namenode.NameNodeHttpServer;
@@ -86,6 +87,16 @@ protected void serviceStart() throws Exception {
8687
RBFConfigKeys.DFS_ROUTER_KERBEROS_INTERNAL_SPNEGO_PRINCIPAL_KEY,
8788
RBFConfigKeys.DFS_ROUTER_KEYTAB_FILE_KEY);
8889

90+
final boolean xFrameEnabled = conf.getBoolean(
91+
DFSConfigKeys.DFS_XFRAME_OPTION_ENABLED,
92+
DFSConfigKeys.DFS_XFRAME_OPTION_ENABLED_DEFAULT);
93+
94+
final String xFrameOptionValue = conf.getTrimmed(
95+
DFSConfigKeys.DFS_XFRAME_OPTION_VALUE,
96+
DFSConfigKeys.DFS_XFRAME_OPTION_VALUE_DEFAULT);
97+
98+
builder.configureXFrame(xFrameEnabled).setXFrameOption(xFrameOptionValue);
99+
89100
this.httpServer = builder.build();
90101

91102
NameNodeHttpServer.initWebHdfs(conf, httpServer,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with this
4+
* work for additional information regarding copyright ownership. The ASF
5+
* licenses this file to you under the Apache License, Version 2.0 (the
6+
* "License"); you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
* <p>
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
* <p>
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
17+
18+
package org.apache.hadoop.hdfs.server.federation.router;
19+
20+
import java.io.IOException;
21+
import java.net.HttpURLConnection;
22+
import java.net.InetSocketAddress;
23+
import java.net.URI;
24+
import java.net.URL;
25+
26+
import org.junit.Assert;
27+
import org.junit.Test;
28+
29+
import org.apache.hadoop.conf.Configuration;
30+
import org.apache.hadoop.hdfs.DFSConfigKeys;
31+
import org.apache.hadoop.hdfs.HdfsConfiguration;
32+
33+
import static org.apache.hadoop.http.HttpServer2.XFrameOption.SAMEORIGIN;
34+
35+
/**
36+
* A class to test the XFrame options of Router HTTP Server.
37+
*/
38+
public class TestRouterHttpServerXFrame {
39+
40+
@Test
41+
public void testRouterXFrame() throws IOException {
42+
Configuration conf = new HdfsConfiguration();
43+
conf.setBoolean(DFSConfigKeys.DFS_XFRAME_OPTION_ENABLED, true);
44+
conf.set(DFSConfigKeys.DFS_XFRAME_OPTION_VALUE, SAMEORIGIN.toString());
45+
46+
Router router = new Router();
47+
try {
48+
router.init(conf);
49+
router.start();
50+
51+
InetSocketAddress httpAddress = router.getHttpServerAddress();
52+
URL url =
53+
URI.create("http://" + httpAddress.getHostName() + ":" + httpAddress.getPort()).toURL();
54+
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
55+
conn.connect();
56+
57+
String xfoHeader = conn.getHeaderField("X-FRAME-OPTIONS");
58+
Assert.assertNotNull("X-FRAME-OPTIONS is absent in the header", xfoHeader);
59+
Assert.assertTrue(xfoHeader.endsWith(SAMEORIGIN.toString()));
60+
} finally {
61+
router.stop();
62+
router.close();
63+
}
64+
}
65+
}

hadoop-project/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
<zookeeper.version>3.8.4</zookeeper.version>
107107
<curator.version>5.2.0</curator.version>
108108
<findbugs.version>3.0.5</findbugs.version>
109-
<dnsjava.version>3.4.0</dnsjava.version>
109+
<dnsjava.version>3.6.1</dnsjava.version>
110110

111111
<guava.version>27.0-jre</guava.version>
112112
<guice.version>5.1.0</guice.version>

0 commit comments

Comments
 (0)