Skip to content

Commit d22b897

Browse files
Merge branch 'apache:trunk' into HADOOP-18325
2 parents 1f6827f + 6207ac4 commit d22b897

File tree

153 files changed

+6791
-1513
lines changed

Some content is hidden

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

153 files changed

+6791
-1513
lines changed

.yetus/excludes.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
dev-support/docker/Dockerfile_windows_10

LICENSE-binary

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,12 +215,12 @@ com.aliyun:aliyun-java-sdk-ecs:4.2.0
215215
com.aliyun:aliyun-java-sdk-ram:3.0.0
216216
com.aliyun:aliyun-java-sdk-sts:3.0.0
217217
com.aliyun.oss:aliyun-sdk-oss:3.13.2
218-
com.amazonaws:aws-java-sdk-bundle:1.12.262
218+
com.amazonaws:aws-java-sdk-bundle:1.12.316
219219
com.cedarsoftware:java-util:1.9.0
220220
com.cedarsoftware:json-io:2.5.1
221221
com.fasterxml.jackson.core:jackson-annotations:2.12.7
222222
com.fasterxml.jackson.core:jackson-core:2.12.7
223-
com.fasterxml.jackson.core:jackson-databind:2.12.7
223+
com.fasterxml.jackson.core:jackson-databind:2.12.7.1
224224
com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.12.7
225225
com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.12.7
226226
com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.7
@@ -306,11 +306,11 @@ org.apache.avro:avro:1.9.2
306306
org.apache.commons:commons-collections4:4.2
307307
org.apache.commons:commons-compress:1.21
308308
org.apache.commons:commons-configuration2:2.8.0
309-
org.apache.commons:commons-csv:1.0
309+
org.apache.commons:commons-csv:1.9.0
310310
org.apache.commons:commons-digester:1.8.1
311311
org.apache.commons:commons-lang3:3.12.0
312312
org.apache.commons:commons-math3:3.6.1
313-
org.apache.commons:commons-text:1.9
313+
org.apache.commons:commons-text:1.10.0
314314
org.apache.commons:commons-validator:1.6
315315
org.apache.curator:curator-client:5.2.0
316316
org.apache.curator:curator-framework:5.2.0
@@ -343,7 +343,7 @@ org.apache.kerby:token-provider:2.0.2
343343
org.apache.solr:solr-solrj:8.8.2
344344
org.apache.yetus:audience-annotations:0.5.0
345345
org.apache.zookeeper:zookeeper:3.6.3
346-
org.codehaus.jettison:jettison:1.1
346+
org.codehaus.jettison:jettison:1.5.1
347347
org.eclipse.jetty:jetty-annotations:9.4.48.v20220622
348348
org.eclipse.jetty:jetty-http:9.4.48.v20220622
349349
org.eclipse.jetty:jetty-io:9.4.48.v20220622
@@ -435,7 +435,7 @@ hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanage
435435
bootstrap v3.3.6
436436
broccoli-asset-rev v2.4.2
437437
broccoli-funnel v1.0.1
438-
datatables v1.10.19
438+
datatables v1.11.5
439439
em-helpers v0.5.13
440440
em-table v0.1.6
441441
ember v2.2.0
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Dockerfile for installing the necessary dependencies for building Hadoop.
18+
# See BUILDING.txt.
19+
20+
FROM mcr.microsoft.com/windows:ltsc2019
21+
22+
# Need to disable the progress bar for speeding up the downloads.
23+
# hadolint ignore=SC2086
24+
RUN powershell $Global:ProgressPreference = 'SilentlyContinue'
25+
26+
# Restore the default Windows shell for correct batch processing.
27+
SHELL ["cmd", "/S", "/C"]
28+
29+
# Install Visual Studio 2019 Build Tools.
30+
RUN curl -SL --output vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe \
31+
&& (start /w vs_buildtools.exe --quiet --wait --norestart --nocache \
32+
--installPath "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\BuildTools" \
33+
--add Microsoft.VisualStudio.Workload.VCTools \
34+
--add Microsoft.VisualStudio.Component.VC.ASAN \
35+
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
36+
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 \
37+
|| IF "%ERRORLEVEL%"=="3010" EXIT 0) \
38+
&& del /q vs_buildtools.exe
39+
40+
# Install Chocolatey.
41+
RUN powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))"
42+
RUN setx PATH "%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
43+
44+
# Install git.
45+
RUN choco install git.install -y
46+
RUN powershell Copy-Item -Recurse -Path 'C:\Program Files\Git' -Destination C:\Git
47+
48+
# Install vcpkg.
49+
# hadolint ignore=DL3003
50+
RUN powershell git clone https://github.com/microsoft/vcpkg.git \
51+
&& cd vcpkg \
52+
&& git checkout 7ffa425e1db8b0c3edf9c50f2f3a0f25a324541d \
53+
&& .\bootstrap-vcpkg.bat
54+
RUN powershell .\vcpkg\vcpkg.exe install boost:x64-windows
55+
RUN powershell .\vcpkg\vcpkg.exe install protobuf:x64-windows
56+
RUN powershell .\vcpkg\vcpkg.exe install openssl:x64-windows
57+
RUN powershell .\vcpkg\vcpkg.exe install zlib:x64-windows
58+
ENV PROTOBUF_HOME "C:\vcpkg\installed\x64-windows"
59+
60+
# Install Azul Java 8 JDK.
61+
RUN powershell Invoke-WebRequest -URI https://cdn.azul.com/zulu/bin/zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip -OutFile $Env:TEMP\zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip
62+
RUN powershell Expand-Archive -Path $Env:TEMP\zulu8.62.0.19-ca-jdk8.0.332-win_x64.zip -DestinationPath "C:\Java"
63+
ENV JAVA_HOME "C:\Java\zulu8.62.0.19-ca-jdk8.0.332-win_x64"
64+
RUN setx PATH "%PATH%;%JAVA_HOME%\bin"
65+
66+
# Install Apache Maven.
67+
RUN powershell Invoke-WebRequest -URI https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip -OutFile $Env:TEMP\apache-maven-3.8.6-bin.zip
68+
RUN powershell Expand-Archive -Path $Env:TEMP\apache-maven-3.8.6-bin.zip -DestinationPath "C:\Maven"
69+
RUN setx PATH "%PATH%;C:\Maven\apache-maven-3.8.6\bin"
70+
ENV MAVEN_OPTS '-Xmx2048M -Xss128M'
71+
72+
# Install CMake 3.19.0.
73+
RUN powershell Invoke-WebRequest -URI https://cmake.org/files/v3.19/cmake-3.19.0-win64-x64.zip -OutFile $Env:TEMP\cmake-3.19.0-win64-x64.zip
74+
RUN powershell Expand-Archive -Path $Env:TEMP\cmake-3.19.0-win64-x64.zip -DestinationPath "C:\CMake"
75+
RUN setx PATH "%PATH%;C:\CMake\cmake-3.19.0-win64-x64\bin"
76+
77+
# We get strange Javadoc errors without this.
78+
RUN setx classpath ""
79+
80+
# Define the entry point for the docker container.
81+
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build\\vcvars64.bat", "&&", "cmd.exe"]

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import java.io.Closeable;
2222
import java.io.FileNotFoundException;
2323
import java.io.IOException;
24-
import java.io.InterruptedIOException;
2524
import java.lang.ref.WeakReference;
2625
import java.lang.ref.ReferenceQueue;
2726
import java.net.URI;
@@ -3647,11 +3646,7 @@ private FileSystem getInternal(URI uri, Configuration conf, Key key)
36473646
// to construct an instance.
36483647
try (DurationInfo d = new DurationInfo(LOGGER, false,
36493648
"Acquiring creator semaphore for %s", uri)) {
3650-
creatorPermits.acquire();
3651-
} catch (InterruptedException e) {
3652-
// acquisition was interrupted; convert to an IOE.
3653-
throw (IOException)new InterruptedIOException(e.toString())
3654-
.initCause(e);
3649+
creatorPermits.acquireUninterruptibly();
36553650
}
36563651
FileSystem fsToClose = null;
36573652
try {

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedReadLock.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@ public class InstrumentedReadLock extends InstrumentedLock {
4444
* there can be multiple threads that hold the read lock concurrently.
4545
*/
4646
private final ThreadLocal<Long> readLockHeldTimeStamp =
47-
new ThreadLocal<Long>() {
48-
@Override
49-
protected Long initialValue() {
50-
return Long.MAX_VALUE;
51-
};
52-
};
47+
ThreadLocal.withInitial(() -> Long.MAX_VALUE);
5348

5449
public InstrumentedReadLock(String name, Logger logger,
5550
ReentrantReadWriteLock readWriteLock,

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/InstrumentedWriteLock.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
@InterfaceStability.Unstable
3838
public class InstrumentedWriteLock extends InstrumentedLock {
3939

40+
private final ReentrantReadWriteLock readWriteLock;
41+
private volatile long writeLockHeldTimeStamp = 0;
42+
4043
public InstrumentedWriteLock(String name, Logger logger,
4144
ReentrantReadWriteLock readWriteLock,
4245
long minLoggingGapMs, long lockWarningThresholdMs) {
@@ -50,5 +53,28 @@ public InstrumentedWriteLock(String name, Logger logger,
5053
long minLoggingGapMs, long lockWarningThresholdMs, Timer clock) {
5154
super(name, logger, readWriteLock.writeLock(), minLoggingGapMs,
5255
lockWarningThresholdMs, clock);
56+
this.readWriteLock = readWriteLock;
57+
}
58+
59+
@Override
60+
public void unlock() {
61+
boolean needReport = readWriteLock.getWriteHoldCount() == 1;
62+
long localWriteReleaseTime = getTimer().monotonicNow();
63+
long localWriteAcquireTime = writeLockHeldTimeStamp;
64+
getLock().unlock();
65+
if (needReport) {
66+
writeLockHeldTimeStamp = 0;
67+
check(localWriteAcquireTime, localWriteReleaseTime, true);
68+
}
69+
}
70+
71+
/**
72+
* Starts timing for the instrumented write lock.
73+
*/
74+
@Override
75+
protected void startLockTiming() {
76+
if (readWriteLock.getWriteHoldCount() == 1) {
77+
writeLockHeldTimeStamp = getTimer().monotonicNow();
78+
}
5379
}
5480
}

hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/XMLUtils.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@
4141
@InterfaceStability.Unstable
4242
public class XMLUtils {
4343

44-
private static final String DISALLOW_DOCTYPE_DECL =
44+
public static final String DISALLOW_DOCTYPE_DECL =
4545
"http://apache.org/xml/features/disallow-doctype-decl";
46-
private static final String LOAD_EXTERNAL_DECL =
46+
public static final String LOAD_EXTERNAL_DECL =
4747
"http://apache.org/xml/features/nonvalidating/load-external-dtd";
48-
private static final String EXTERNAL_GENERAL_ENTITIES =
48+
public static final String EXTERNAL_GENERAL_ENTITIES =
4949
"http://xml.org/sax/features/external-general-entities";
50-
private static final String EXTERNAL_PARAMETER_ENTITIES =
50+
public static final String EXTERNAL_PARAMETER_ENTITIES =
5151
"http://xml.org/sax/features/external-parameter-entities";
52-
private static final String CREATE_ENTITY_REF_NODES =
52+
public static final String CREATE_ENTITY_REF_NODES =
5353
"http://apache.org/xml/features/dom/create-entity-ref-nodes";
54-
54+
public static final String VALIDATION =
55+
"http://xml.org/sax/features/validation";
5556

5657
/**
5758
* Transform input xml given a stylesheet.

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestInstrumentedReadWriteLock.java

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,111 @@ protected void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
233233
assertEquals(2, wlogged.get());
234234
assertEquals(1, wsuppresed.get());
235235
}
236+
237+
238+
/**
239+
* Tests the warning when the write lock is held longer than threshold.
240+
*/
241+
@Test(timeout=10000)
242+
public void testWriteLockLongHoldingReportWithReentrant() {
243+
String testname = name.getMethodName();
244+
final AtomicLong time = new AtomicLong(0);
245+
Timer mclock = new Timer() {
246+
@Override
247+
public long monotonicNow() {
248+
return time.get();
249+
}
250+
};
251+
252+
final AtomicLong wlogged = new AtomicLong(0);
253+
final AtomicLong wsuppresed = new AtomicLong(0);
254+
final AtomicLong totalHeldTime = new AtomicLong(0);
255+
ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(true);
256+
InstrumentedWriteLock writeLock = new InstrumentedWriteLock(testname, LOG,
257+
readWriteLock, 2000, 300, mclock) {
258+
@Override
259+
protected void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
260+
totalHeldTime.addAndGet(lockHeldTime);
261+
wlogged.incrementAndGet();
262+
wsuppresed.set(stats.getSuppressedCount());
263+
}
264+
};
265+
266+
InstrumentedReadLock readLock = new InstrumentedReadLock(testname, LOG,
267+
readWriteLock, 2000, 300, mclock) {
268+
@Override
269+
protected void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
270+
totalHeldTime.addAndGet(lockHeldTime);
271+
wlogged.incrementAndGet();
272+
wsuppresed.set(stats.getSuppressedCount());
273+
}
274+
};
275+
276+
writeLock.lock(); // t = 0
277+
time.set(100);
278+
279+
writeLock.lock(); // t = 100
280+
time.set(500);
281+
282+
writeLock.lock(); // t = 500
283+
time.set(2900);
284+
writeLock.unlock(); // t = 2900
285+
286+
readLock.lock(); // t = 2900
287+
time.set(3000);
288+
readLock.unlock(); // t = 3000
289+
290+
writeLock.unlock(); // t = 3000
291+
292+
writeLock.unlock(); // t = 3000
293+
assertEquals(1, wlogged.get());
294+
assertEquals(0, wsuppresed.get());
295+
assertEquals(3000, totalHeldTime.get());
296+
}
297+
298+
/**
299+
* Tests the warning when the read lock is held longer than threshold.
300+
*/
301+
@Test(timeout=10000)
302+
public void testReadLockLongHoldingReportWithReentrant() {
303+
String testname = name.getMethodName();
304+
final AtomicLong time = new AtomicLong(0);
305+
Timer mclock = new Timer() {
306+
@Override
307+
public long monotonicNow() {
308+
return time.get();
309+
}
310+
};
311+
312+
final AtomicLong wlogged = new AtomicLong(0);
313+
final AtomicLong wsuppresed = new AtomicLong(0);
314+
final AtomicLong totalHelpTime = new AtomicLong(0);
315+
ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock(true);
316+
InstrumentedReadLock readLock = new InstrumentedReadLock(testname, LOG,
317+
readWriteLock, 2000, 300, mclock) {
318+
@Override
319+
protected void logWarning(long lockHeldTime, SuppressedSnapshot stats) {
320+
totalHelpTime.addAndGet(lockHeldTime);
321+
wlogged.incrementAndGet();
322+
wsuppresed.set(stats.getSuppressedCount());
323+
}
324+
};
325+
326+
readLock.lock(); // t = 0
327+
time.set(100);
328+
329+
readLock.lock(); // t = 100
330+
time.set(500);
331+
332+
readLock.lock(); // t = 500
333+
time.set(3000);
334+
readLock.unlock(); // t = 3000
335+
336+
readLock.unlock(); // t = 3000
337+
338+
readLock.unlock(); // t = 3000
339+
assertEquals(1, wlogged.get());
340+
assertEquals(0, wsuppresed.get());
341+
assertEquals(3000, totalHelpTime.get());
342+
}
236343
}

0 commit comments

Comments
 (0)