Skip to content

Commit 6656ae5

Browse files
authored
Merge pull request #1 from apache/trunk
merge from upstream
2 parents 8035749 + fda86ef commit 6656ae5

File tree

1,072 files changed

+117560
-14599
lines changed

Some content is hidden

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

1,072 files changed

+117560
-14599
lines changed

BUILDING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Requirements:
55

66
* Unix System
77
* JDK 1.8+
8-
* Maven 3.0 or later
8+
* Maven 3.3 or later
99
* Findbugs 1.3.9 (if running findbugs)
1010
* ProtocolBuffer 2.5.0
1111
* CMake 2.6 or newer (if compiling native code), must be 3.0 or newer on Mac

LICENSE.txt

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,9 @@ Azure Data Lake Store - Java client SDK 2.0.11
631631
JCodings 1.0.8
632632
Joni 2.1.2
633633
Mockito 1.8.5
634-
JUL to SLF4J bridge 1.7.10
635-
SLF4J API Module 1.7.10
636-
SLF4J LOG4J-12 Binding 1.7.10
634+
JUL to SLF4J bridge 1.7.25
635+
SLF4J API Module 1.7.25
636+
SLF4J LOG4J-12 Binding 1.7.25
637637
--------------------------------------------------------------------------------
638638

639639
The MIT License (MIT)
@@ -736,7 +736,7 @@ hadoop-tools/hadoop-sls/src/main/html/js/thirdparty/d3-LICENSE
736736

737737
The binary distribution of this product bundles these dependencies under the
738738
following license:
739-
HSQLDB Database 2.0.0
739+
HSQLDB Database 2.3.4
740740
--------------------------------------------------------------------------------
741741
(HSQL License)
742742
"COPYRIGHTS AND LICENSES (based on BSD License)
@@ -1711,7 +1711,6 @@ Hamcrest Core 1.3
17111711
ASM Core 5.0.4
17121712
ASM Commons 5.0.2
17131713
ASM Tree 5.0.2
1714-
xmlenc Library 0.52
17151714
--------------------------------------------------------------------------------
17161715
(3-clause BSD)
17171716
Redistribution and use in source and binary forms, with or without
@@ -2659,4 +2658,24 @@ available under the Creative Commons By Attribution 3.0 License.
26592658
available upon request from time to time. For the avoidance of doubt,
26602659
this trademark restriction does not form part of this License.
26612660

2662-
Creative Commons may be contacted at https://creativecommons.org/.
2661+
Creative Commons may be contacted at https://creativecommons.org/.
2662+
--------------------------------------------------------------------------------
2663+
2664+
For: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs
2665+
/server/datanode/checker/AbstractFuture.java and
2666+
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs
2667+
/server/datanode/checker/TimeoutFuture.java
2668+
2669+
Copyright (C) 2007 The Guava Authors
2670+
2671+
Licensed under the Apache License, Version 2.0 (the "License"); you may not
2672+
use this file except in compliance with the License. You may obtain a copy of
2673+
the License at
2674+
2675+
http://www.apache.org/licenses/LICENSE-2.0
2676+
2677+
Unless required by applicable law or agreed to in writing, software
2678+
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
2679+
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
2680+
License for the specific language governing permissions and limitations under
2681+
the License.

dev-support/bin/yetus-wrapper

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
# you must be this high to ride the ride
18+
if [[ -z "${BASH_VERSINFO[0]}" ]] \
19+
|| [[ "${BASH_VERSINFO[0]}" -lt 3 ]] \
20+
|| [[ "${BASH_VERSINFO[0]}" -eq 3 && "${BASH_VERSINFO[1]}" -lt 2 ]]; then
21+
echo "bash v3.2+ is required. Sorry."
22+
exit 1
23+
fi
24+
1725
set -o pipefail
1826

1927
## @description Print a message to stderr
@@ -39,6 +47,7 @@ function yetus_abs
3947
declare obj=$1
4048
declare dir
4149
declare fn
50+
declare dirret
4251

4352
if [[ ! -e ${obj} ]]; then
4453
return 1
@@ -51,7 +60,8 @@ function yetus_abs
5160
fi
5261

5362
dir=$(cd -P -- "${dir}" >/dev/null 2>/dev/null && pwd -P)
54-
if [[ $? = 0 ]]; then
63+
dirret=$?
64+
if [[ ${dirret} = 0 ]]; then
5565
echo "${dir}${fn}"
5666
return 0
5767
fi
@@ -63,7 +73,7 @@ WANTED="$1"
6373
shift
6474
ARGV=("$@")
6575

66-
HADOOP_YETUS_VERSION=${HADOOP_YETUS_VERSION:-0.3.0}
76+
HADOOP_YETUS_VERSION=${HADOOP_YETUS_VERSION:-0.4.0}
6777
BIN=$(yetus_abs "${BASH_SOURCE-$0}")
6878
BINDIR=$(dirname "${BIN}")
6979

@@ -85,7 +95,8 @@ if [[ ! -d "${HADOOP_PATCHPROCESS}" ]]; then
8595
fi
8696

8797
mytmpdir=$(yetus_abs "${HADOOP_PATCHPROCESS}")
88-
if [[ $? != 0 ]]; then
98+
ret=$?
99+
if [[ ${ret} != 0 ]]; then
89100
yetus_error "yetus-dl: Unable to cwd to ${HADOOP_PATCHPROCESS}"
90101
exit 1
91102
fi
@@ -108,15 +119,13 @@ TARBALL="yetus-${HADOOP_YETUS_VERSION}-bin.tar"
108119
GPGBIN=$(command -v gpg)
109120
CURLBIN=$(command -v curl)
110121

111-
pushd "${HADOOP_PATCHPROCESS}" >/dev/null
112-
if [[ $? != 0 ]]; then
122+
if ! pushd "${HADOOP_PATCHPROCESS}" >/dev/null; then
113123
yetus_error "ERROR: yetus-dl: Cannot pushd to ${HADOOP_PATCHPROCESS}"
114124
exit 1
115125
fi
116126

117127
if [[ -n "${CURLBIN}" ]]; then
118-
"${CURLBIN}" -f -s -L -O "${BASEURL}/${TARBALL}.gz"
119-
if [[ $? != 0 ]]; then
128+
if ! "${CURLBIN}" -f -s -L -O "${BASEURL}/${TARBALL}.gz"; then
120129
yetus_error "ERROR: yetus-dl: unable to download ${BASEURL}/${TARBALL}.gz"
121130
exit 1
122131
fi
@@ -126,40 +135,33 @@ else
126135
fi
127136

128137
if [[ -n "${GPGBIN}" ]]; then
129-
mkdir -p .gpg
130-
if [[ $? != 0 ]]; then
138+
if ! mkdir -p .gpg; then
131139
yetus_error "ERROR: yetus-dl: Unable to create ${HADOOP_PATCHPROCESS}/.gpg"
132140
exit 1
133141
fi
134-
chmod -R 700 .gpg
135-
if [[ $? != 0 ]]; then
142+
if ! chmod -R 700 .gpg; then
136143
yetus_error "ERROR: yetus-dl: Unable to chmod ${HADOOP_PATCHPROCESS}/.gpg"
137144
exit 1
138145
fi
139-
"${CURLBIN}" -s -L -o KEYS_YETUS https://dist.apache.org/repos/dist/release/yetus/KEYS
140-
if [[ $? != 0 ]]; then
146+
if ! "${CURLBIN}" -s -L -o KEYS_YETUS https://dist.apache.org/repos/dist/release/yetus/KEYS; then
141147
yetus_error "ERROR: yetus-dl: unable to fetch https://dist.apache.org/repos/dist/release/yetus/KEYS"
142148
exit 1
143149
fi
144-
"${CURLBIN}" -s -L -O "${BASEURL}/${TARBALL}.gz.asc"
145-
if [[ $? != 0 ]]; then
150+
if ! "${CURLBIN}" -s -L -O "${BASEURL}/${TARBALL}.gz.asc"; then
146151
yetus_error "ERROR: yetus-dl: unable to fetch ${BASEURL}/${TARBALL}.gz.asc"
147152
exit 1
148153
fi
149-
"${GPGBIN}" --homedir "${HADOOP_PATCHPROCESS}/.gpg" --import "${HADOOP_PATCHPROCESS}/KEYS_YETUS" >/dev/null 2>&1
150-
if [[ $? != 0 ]]; then
154+
if ! "${GPGBIN}" --homedir "${HADOOP_PATCHPROCESS}/.gpg" --import "${HADOOP_PATCHPROCESS}/KEYS_YETUS" >/dev/null 2>&1; then
151155
yetus_error "ERROR: yetus-dl: gpg unable to import ${HADOOP_PATCHPROCESS}/KEYS_YETUS"
152156
exit 1
153157
fi
154-
"${GPGBIN}" --homedir "${HADOOP_PATCHPROCESS}/.gpg" --verify "${TARBALL}.gz.asc" >/dev/null 2>&1
155-
if [[ $? != 0 ]]; then
158+
if ! "${GPGBIN}" --homedir "${HADOOP_PATCHPROCESS}/.gpg" --verify "${TARBALL}.gz.asc" >/dev/null 2>&1; then
156159
yetus_error "ERROR: yetus-dl: gpg verify of tarball in ${HADOOP_PATCHPROCESS} failed"
157160
exit 1
158161
fi
159162
fi
160163

161-
gunzip -c "${TARBALL}.gz" | tar xpf -
162-
if [[ $? != 0 ]]; then
164+
if ! (gunzip -c "${TARBALL}.gz" | tar xpf -); then
163165
yetus_error "ERROR: ${TARBALL}.gz is corrupt. Investigate and then remove ${HADOOP_PATCHPROCESS} to try again."
164166
exit 1
165167
fi

dev-support/docker/Dockerfile

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
5858
protobuf-c-compiler \
5959
python \
6060
python2.7 \
61+
python2.7-dev \
6162
python-pip \
6263
rsync \
6364
snappy \
@@ -81,13 +82,17 @@ RUN apt-get -q install --no-install-recommends -y oracle-java8-installer
8182
####
8283
# Apps that require Java
8384
###
84-
RUN apt-get -q update && apt-get -q install --no-install-recommends -y \
85-
ant \
86-
maven
85+
RUN apt-get -q update && apt-get -q install --no-install-recommends -y ant
8786

88-
# Fixing the Apache commons / Maven dependency problem under Ubuntu:
89-
# See http://wiki.apache.org/commons/VfsProblems
90-
RUN cd /usr/share/maven/lib && ln -s ../../java/commons-lang.jar .
87+
######
88+
# Install Apache Maven
89+
######
90+
RUN mkdir -p /opt/maven && \
91+
curl -L -s -S \
92+
http://www-us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz \
93+
-o /opt/maven.tar.gz && \
94+
tar xzf /opt/maven.tar.gz --strip-components 1 -C /opt/maven
95+
ENV MAVEN_HOME /opt/maven
9196

9297
######
9398
# Install findbugs

hadoop-client-modules/hadoop-client-integration-tests/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@
145145
<artifactId>hadoop-common</artifactId>
146146
<scope>test</scope>
147147
</dependency>
148+
<dependency>
149+
<groupId>org.apache.hadoop</groupId>
150+
<artifactId>hadoop-hdfs-client</artifactId>
151+
<scope>test</scope>
152+
</dependency>
148153
<dependency>
149154
<groupId>org.apache.hadoop</groupId>
150155
<artifactId>hadoop-hdfs</artifactId>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,6 @@
218218
<groupId>javax.servlet</groupId>
219219
<artifactId>javax.servlet-api</artifactId>
220220
</exclusion>
221-
<exclusion>
222-
<groupId>xmlenc</groupId>
223-
<artifactId>xmlenc</artifactId>
224-
</exclusion>
225221
</exclusions>
226222
</dependency>
227223
<!-- Add optional runtime dependency on the in-development timeline server module

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@
8585
<groupId>net.sf.kosmosfs</groupId>
8686
<artifactId>kfs</artifactId>
8787
</exclusion>
88-
<exclusion>
89-
<groupId>net.java.dev.jets3t</groupId>
90-
<artifactId>jets3t</artifactId>
91-
</exclusion>
9288
<exclusion>
9389
<groupId>com.jcraft</groupId>
9490
<artifactId>jsch</artifactId>

hadoop-cloud-storage-project/hadoop-cloud-storage/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@
9393
<groupId>net.sf.kosmosfs</groupId>
9494
<artifactId>kfs</artifactId>
9595
</exclusion>
96-
<exclusion>
97-
<groupId>net.java.dev.jets3t</groupId>
98-
<artifactId>jets3t</artifactId>
99-
</exclusion>
10096
<exclusion>
10197
<groupId>com.jcraft</groupId>
10298
<artifactId>jsch</artifactId>

hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/RandomSignerSecretProvider.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515

1616
import com.google.common.annotations.VisibleForTesting;
1717

18-
import java.nio.charset.Charset;
18+
import java.security.SecureRandom;
1919
import java.util.Random;
20+
2021
import org.apache.hadoop.classification.InterfaceAudience;
2122
import org.apache.hadoop.classification.InterfaceStability;
2223

@@ -32,7 +33,7 @@ public class RandomSignerSecretProvider extends RolloverSignerSecretProvider {
3233

3334
public RandomSignerSecretProvider() {
3435
super();
35-
rand = new Random();
36+
rand = new SecureRandom();
3637
}
3738

3839
/**
@@ -48,6 +49,8 @@ public RandomSignerSecretProvider(long seed) {
4849

4950
@Override
5051
protected byte[] generateNewSecret() {
51-
return Long.toString(rand.nextLong()).getBytes(Charset.forName("UTF-8"));
52+
byte[] secret = new byte[32]; // 32 bytes = 256 bits
53+
rand.nextBytes(secret);
54+
return secret;
5255
}
5356
}

hadoop-common-project/hadoop-auth/src/main/java/org/apache/hadoop/security/authentication/util/ZKSignerSecretProvider.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.google.common.annotations.VisibleForTesting;
1717
import java.nio.ByteBuffer;
1818
import java.nio.charset.Charset;
19+
import java.security.SecureRandom;
1920
import java.util.Collections;
2021
import java.util.HashMap;
2122
import java.util.List;
@@ -149,7 +150,7 @@ public class ZKSignerSecretProvider extends RolloverSignerSecretProvider {
149150

150151
public ZKSignerSecretProvider() {
151152
super();
152-
rand = new Random();
153+
rand = new SecureRandom();
153154
}
154155

155156
/**
@@ -342,8 +343,11 @@ private synchronized void pullFromZK(boolean isInit) {
342343
}
343344
}
344345

345-
private byte[] generateRandomSecret() {
346-
return Long.toString(rand.nextLong()).getBytes(Charset.forName("UTF-8"));
346+
@VisibleForTesting
347+
protected byte[] generateRandomSecret() {
348+
byte[] secret = new byte[32]; // 32 bytes = 256 bits
349+
rand.nextBytes(secret);
350+
return secret;
347351
}
348352

349353
/**

0 commit comments

Comments
 (0)