Skip to content

Commit de035ea

Browse files
authored
Merge branch 'apache:trunk' into HADOOP-19415-PART7
2 parents 2498e59 + fd380ef commit de035ea

File tree

103 files changed

+1619
-1521
lines changed

Some content is hidden

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

103 files changed

+1619
-1521
lines changed

dev-support/docker/Dockerfile_windows_10

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ RUN powershell pkg-resolver\install-python.ps1
119119
RUN powershell pkg-resolver\install-pip.ps1
120120
RUN powershell pip install python-dateutil
121121

122+
## Install the Microsoft Visual C++ 2010 Redistributable to link leveldbjni native library
123+
RUN powershell -Command Invoke-WebRequest -Uri https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_x64.exe -OutFile vcredist_x64.exe
124+
RUN powershell -Command Start-Process -FilePath .\vcredist_x64.exe -ArgumentList '/quiet', '/norestart' -Wait
125+
RUN powershell -Command Remove-Item vcredist_x64.exe
126+
122127
# Create a user HadoopBuilder with basic privileges and use it for building Hadoop on Windows.
123128
RUN powershell New-LocalUser -Name 'HadoopBuilder' -Description 'User account for building Apache Hadoop' -Password ([securestring]::new()) -AccountNeverExpires -PasswordNeverExpires
124129

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/audit/TestCommonAuditContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import java.util.stream.StreamSupport;
2626

2727
import org.assertj.core.api.AbstractStringAssert;
28-
import org.junit.Test;
28+
import org.junit.jupiter.api.Test;
2929
import org.slf4j.Logger;
3030
import org.slf4j.LoggerFactory;
3131

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/TestFlagSet.java

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
import java.util.EnumSet;
2222

23-
import org.assertj.core.api.Assertions;
24-
import org.junit.Test;
23+
import org.junit.jupiter.api.Test;
2524

2625
import org.apache.hadoop.conf.Configuration;
2726
import org.apache.hadoop.test.AbstractHadoopTestBase;
@@ -31,6 +30,7 @@
3130
import static org.apache.hadoop.fs.impl.FlagSet.buildFlagSet;
3231
import static org.apache.hadoop.fs.impl.FlagSet.createFlagSet;
3332
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
33+
import static org.assertj.core.api.Assertions.assertThat;
3434

3535
/**
3636
* Unit tests for {@link FlagSet} class.
@@ -68,7 +68,7 @@ private enum OtherEnum { a }
6868
*/
6969
@Test
7070
public void testEntryEnableDisable() {
71-
Assertions.assertThat(flagSet.flags()).isEmpty();
71+
assertThat(flagSet.flags()).isEmpty();
7272
assertDisabled(SimpleEnum.a);
7373
flagSet.enable(SimpleEnum.a);
7474
assertEnabled(SimpleEnum.a);
@@ -81,7 +81,7 @@ public void testEntryEnableDisable() {
8181
*/
8282
@Test
8383
public void testSetMethod() {
84-
Assertions.assertThat(flagSet.flags()).isEmpty();
84+
assertThat(flagSet.flags()).isEmpty();
8585
flagSet.set(SimpleEnum.a, true);
8686
assertEnabled(SimpleEnum.a);
8787
flagSet.set(SimpleEnum.a, false);
@@ -136,15 +136,15 @@ public void testToString() throws Throwable {
136136
* @param expected expected value
137137
*/
138138
private void assertStringValue(final String expected) {
139-
Assertions.assertThat(flagSet.toString())
139+
assertThat(flagSet.toString())
140140
.isEqualTo(expected);
141141
}
142142

143143
/**
144144
* Assert the configuration string form matches that expected.
145145
*/
146146
public void assertConfigurationStringMatches(final String expected) {
147-
Assertions.assertThat(flagSet.toConfigurationString())
147+
assertThat(flagSet.toConfigurationString())
148148
.describedAs("Configuration string of %s", flagSet)
149149
.isEqualTo(expected);
150150
}
@@ -224,7 +224,7 @@ private static Configuration mkConf(final String value) {
224224
* @param capability capability to probe for
225225
*/
226226
private void assertHasCapability(final String capability) {
227-
Assertions.assertThat(flagSet.hasCapability(capability))
227+
assertThat(flagSet.hasCapability(capability))
228228
.describedAs("Capability of %s on %s", capability, flagSet)
229229
.isTrue();
230230
}
@@ -234,7 +234,7 @@ private void assertHasCapability(final String capability) {
234234
* @param capability capability to probe for
235235
*/
236236
private void assertLacksCapability(final String capability) {
237-
Assertions.assertThat(flagSet.hasCapability(capability))
237+
assertThat(flagSet.hasCapability(capability))
238238
.describedAs("Capability of %s on %s", capability, flagSet)
239239
.isFalse();
240240
}
@@ -248,7 +248,7 @@ public void testStarEntry() {
248248
assertFlags(SimpleEnum.a, SimpleEnum.b, SimpleEnum.c);
249249
assertHasCapability(CAPABILITY_A);
250250
assertHasCapability(CAPABILITY_B);
251-
Assertions.assertThat(flagSet.pathCapabilities())
251+
assertThat(flagSet.pathCapabilities())
252252
.describedAs("path capabilities of %s", flagSet)
253253
.containsExactlyInAnyOrder(CAPABILITY_A, CAPABILITY_B, CAPABILITY_C);
254254
}
@@ -259,7 +259,7 @@ public void testRoundTrip() {
259259
KEYDOT,
260260
allOf(SimpleEnum.class));
261261
final FlagSet<SimpleEnum> s2 = roundTrip(s1);
262-
Assertions.assertThat(s1.flags()).isEqualTo(s2.flags());
262+
assertThat(s1.flags()).isEqualTo(s2.flags());
263263
assertFlagSetMatches(s2, SimpleEnum.a, SimpleEnum.b, SimpleEnum.c);
264264
}
265265

@@ -268,13 +268,13 @@ public void testEmptyRoundTrip() {
268268
final FlagSet<SimpleEnum> s1 = createFlagSet(SimpleEnum.class, KEYDOT,
269269
noneOf(SimpleEnum.class));
270270
final FlagSet<SimpleEnum> s2 = roundTrip(s1);
271-
Assertions.assertThat(s1.flags())
271+
assertThat(s1.flags())
272272
.isEqualTo(s2.flags());
273-
Assertions.assertThat(s2.isEmpty())
273+
assertThat(s2.isEmpty())
274274
.describedAs("empty flagset %s", s2)
275275
.isTrue();
276276
assertFlagSetMatches(flagSet);
277-
Assertions.assertThat(flagSet.pathCapabilities())
277+
assertThat(flagSet.pathCapabilities())
278278
.describedAs("path capabilities of %s", flagSet)
279279
.isEmpty();
280280
}
@@ -298,10 +298,10 @@ public void testEquality() {
298298
final FlagSet<SimpleEnum> s2 = createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a);
299299
// make one of them immutable
300300
s2.makeImmutable();
301-
Assertions.assertThat(s1)
301+
assertThat(s1)
302302
.describedAs("s1 == s2")
303303
.isEqualTo(s2);
304-
Assertions.assertThat(s1.hashCode())
304+
assertThat(s1.hashCode())
305305
.describedAs("hashcode of s1 == hashcode of s2")
306306
.isEqualTo(s2.hashCode());
307307
}
@@ -312,7 +312,7 @@ public void testInequality() {
312312
createFlagSet(SimpleEnum.class, KEYDOT, noneOf(SimpleEnum.class));
313313
final FlagSet<SimpleEnum> s2 =
314314
createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a, SimpleEnum.b);
315-
Assertions.assertThat(s1)
315+
assertThat(s1)
316316
.describedAs("s1 == s2")
317317
.isNotEqualTo(s2);
318318
}
@@ -323,7 +323,7 @@ public void testClassInequality() {
323323
createFlagSet(SimpleEnum.class, KEYDOT, noneOf(SimpleEnum.class));
324324
final FlagSet<?> s2 =
325325
createFlagSet(OtherEnum.class, KEYDOT, OtherEnum.a);
326-
Assertions.assertThat(s1)
326+
assertThat(s1)
327327
.describedAs("s1 == s2")
328328
.isNotEqualTo(s2);
329329
}
@@ -338,13 +338,13 @@ public void testCopy() throws Throwable {
338338
createFlagSet(SimpleEnum.class, KEYDOT, SimpleEnum.a, SimpleEnum.b);
339339
s1.makeImmutable();
340340
FlagSet<SimpleEnum> s2 = s1.copy();
341-
Assertions.assertThat(s2)
341+
assertThat(s2)
342342
.describedAs("copy of %s", s1)
343343
.isNotSameAs(s1);
344-
Assertions.assertThat(!s2.isImmutable())
344+
assertThat(!s2.isImmutable())
345345
.describedAs("set %s is immutable", s2)
346346
.isTrue();
347-
Assertions.assertThat(s1)
347+
assertThat(s1)
348348
.describedAs("s1 == s2")
349349
.isEqualTo(s2);
350350
}
@@ -377,7 +377,7 @@ private FlagSet<SimpleEnum> roundTrip(FlagSet<SimpleEnum> flagset) {
377377
* @param flag flag to check
378378
*/
379379
private void assertEnabled(final SimpleEnum flag) {
380-
Assertions.assertThat(flagSet.enabled(flag))
380+
assertThat(flagSet.enabled(flag))
381381
.describedAs("status of flag %s in %s", flag, flagSet)
382382
.isTrue();
383383
}
@@ -387,7 +387,7 @@ private void assertEnabled(final SimpleEnum flag) {
387387
* @param flag flag to check
388388
*/
389389
private void assertDisabled(final SimpleEnum flag) {
390-
Assertions.assertThat(flagSet.enabled(flag))
390+
assertThat(flagSet.enabled(flag))
391391
.describedAs("status of flag %s in %s", flag, flagSet)
392392
.isFalse();
393393
}
@@ -409,7 +409,7 @@ private void assertFlags(final SimpleEnum... flags) {
409409
private void assertFlagSetMatches(
410410
FlagSet<SimpleEnum> fs,
411411
SimpleEnum... flags) {
412-
Assertions.assertThat(fs.flags())
412+
assertThat(fs.flags())
413413
.describedAs("path capabilities of %s", fs)
414414
.containsExactly(flags);
415415
}
@@ -424,7 +424,7 @@ private void assertFlagSetMatches(
424424
private void assertPathCapabilitiesMatch(
425425
FlagSet<SimpleEnum> fs,
426426
String... capabilities) {
427-
Assertions.assertThat(fs.pathCapabilities())
427+
assertThat(fs.pathCapabilities())
428428
.describedAs("path capabilities of %s", fs)
429429
.containsExactlyInAnyOrder(capabilities);
430430
}

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/TestLeakReporter.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020

2121
import java.util.concurrent.atomic.AtomicInteger;
2222

23-
import org.assertj.core.api.Assertions;
24-
import org.junit.Test;
23+
import org.junit.jupiter.api.Test;
2524
import org.slf4j.Logger;
2625
import org.slf4j.LoggerFactory;
2726

@@ -30,6 +29,7 @@
3029

3130
import static org.apache.hadoop.fs.impl.LeakReporter.THREAD_FORMAT;
3231
import static org.apache.hadoop.test.GenericTestUtils.LogCapturer.captureLogs;
32+
import static org.assertj.core.api.Assertions.assertThat;
3333

3434
public final class TestLeakReporter extends AbstractHadoopTestBase {
3535

@@ -74,7 +74,7 @@ public void testLeakInvocation() throws Throwable {
7474
oldName,
7575
Thread.currentThread().getId());
7676
// log auditing
77-
Assertions.assertThat(output)
77+
assertThat(output)
7878
.describedAs("output from the logs")
7979
.contains("WARN")
8080
.contains(message)
@@ -140,7 +140,7 @@ public void testCloseActionSwallowed() throws Throwable {
140140
this::raiseNPE);
141141
reporter.close();
142142

143-
Assertions.assertThat(reporter.isClosed())
143+
assertThat(reporter.isClosed())
144144
.describedAs("reporter closed)")
145145
.isTrue();
146146
}
@@ -158,7 +158,7 @@ private boolean raiseNPE() {
158158
* @param ex expected.
159159
*/
160160
private void assertCloseCount(final int ex) {
161-
Assertions.assertThat(closeCount.get())
161+
assertThat(closeCount.get())
162162
.describedAs("close count")
163163
.isEqualTo(ex);
164164
}

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBlockCache.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121

2222
import java.nio.ByteBuffer;
2323

24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
import org.apache.hadoop.conf.Configuration;
2727
import org.apache.hadoop.fs.LocalDirAllocator;
2828
import org.apache.hadoop.test.AbstractHadoopTestBase;
2929

3030
import static org.apache.hadoop.fs.CommonConfigurationKeys.HADOOP_TMP_DIR;
3131
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
32-
import static org.junit.Assert.assertEquals;
33-
import static org.junit.Assert.assertFalse;
34-
import static org.junit.Assert.assertNotNull;
35-
import static org.junit.Assert.assertNotSame;
36-
import static org.junit.Assert.assertTrue;
32+
import static org.junit.jupiter.api.Assertions.assertEquals;
33+
import static org.junit.jupiter.api.Assertions.assertFalse;
34+
import static org.junit.jupiter.api.Assertions.assertNotNull;
35+
import static org.junit.jupiter.api.Assertions.assertNotSame;
36+
import static org.junit.jupiter.api.Assertions.assertTrue;
3737

3838
public class TestBlockCache extends AbstractHadoopTestBase {
3939

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBlockData.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@
1919

2020
package org.apache.hadoop.fs.impl.prefetch;
2121

22-
import org.junit.Test;
22+
import org.junit.jupiter.api.Test;
2323

2424
import org.apache.hadoop.test.AbstractHadoopTestBase;
2525

2626
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
27-
import static org.junit.Assert.assertEquals;
28-
import static org.junit.Assert.assertFalse;
29-
import static org.junit.Assert.assertTrue;
27+
import static org.junit.jupiter.api.Assertions.assertEquals;
28+
import static org.junit.jupiter.api.Assertions.assertFalse;
29+
import static org.junit.jupiter.api.Assertions.assertTrue;
3030

3131
public class TestBlockData extends AbstractHadoopTestBase {
3232

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBlockOperations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
import java.lang.reflect.Method;
2323

24-
import org.junit.Test;
24+
import org.junit.jupiter.api.Test;
2525

2626
import org.apache.hadoop.test.AbstractHadoopTestBase;
2727

2828
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
29-
import static org.junit.Assert.assertTrue;
29+
import static org.junit.jupiter.api.Assertions.assertTrue;
3030

3131
public class TestBlockOperations extends AbstractHadoopTestBase {
3232

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBoundedResourcePool.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
import java.util.IdentityHashMap;
2525
import java.util.Set;
2626

27-
import org.junit.Test;
27+
import org.junit.jupiter.api.Test;
2828

2929
import org.apache.hadoop.test.AbstractHadoopTestBase;
3030

3131
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
32-
import static org.junit.Assert.assertEquals;
33-
import static org.junit.Assert.assertFalse;
34-
import static org.junit.Assert.assertNotNull;
35-
import static org.junit.Assert.assertSame;
36-
import static org.junit.Assert.assertTrue;
32+
import static org.junit.jupiter.api.Assertions.assertEquals;
33+
import static org.junit.jupiter.api.Assertions.assertFalse;
34+
import static org.junit.jupiter.api.Assertions.assertNotNull;
35+
import static org.junit.jupiter.api.Assertions.assertSame;
36+
import static org.junit.jupiter.api.Assertions.assertTrue;
3737

3838
public class TestBoundedResourcePool extends AbstractHadoopTestBase {
3939

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBufferData.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
import java.util.List;
2727
import java.util.concurrent.CompletableFuture;
2828

29-
import org.junit.Test;
29+
import org.junit.jupiter.api.Test;
3030

3131
import org.apache.hadoop.test.AbstractHadoopTestBase;
3232

3333
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
34-
import static org.junit.Assert.assertEquals;
35-
import static org.junit.Assert.assertNotEquals;
36-
import static org.junit.Assert.assertNotNull;
37-
import static org.junit.Assert.assertNotSame;
38-
import static org.junit.Assert.assertSame;
34+
import static org.junit.jupiter.api.Assertions.assertEquals;
35+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
36+
import static org.junit.jupiter.api.Assertions.assertNotNull;
37+
import static org.junit.jupiter.api.Assertions.assertNotSame;
38+
import static org.junit.jupiter.api.Assertions.assertSame;
3939

4040
public class TestBufferData extends AbstractHadoopTestBase {
4141

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/impl/prefetch/TestBufferPool.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
package org.apache.hadoop.fs.impl.prefetch;
2121

22-
import org.junit.Test;
22+
import org.junit.jupiter.api.Test;
2323

2424
import org.apache.hadoop.test.AbstractHadoopTestBase;
2525

2626
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
27-
import static org.junit.Assert.assertEquals;
28-
import static org.junit.Assert.assertNotNull;
29-
import static org.junit.Assert.assertNull;
30-
import static org.junit.Assert.assertSame;
27+
import static org.junit.jupiter.api.Assertions.assertEquals;
28+
import static org.junit.jupiter.api.Assertions.assertNotNull;
29+
import static org.junit.jupiter.api.Assertions.assertNull;
30+
import static org.junit.jupiter.api.Assertions.assertSame;
3131

3232
public class TestBufferPool extends AbstractHadoopTestBase {
3333

0 commit comments

Comments
 (0)