Skip to content

Commit c76488d

Browse files
committed
HBASE-27443 Use java11 in the general check of our jenkins job
1 parent 792f12b commit c76488d

File tree

8 files changed

+47
-46
lines changed

8 files changed

+47
-46
lines changed

dev-support/Jenkinsfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,9 @@ pipeline {
202202
environment {
203203
BASEDIR = "${env.WORKSPACE}/component"
204204
TESTS = "${env.SHALLOW_CHECKS}"
205-
SET_JAVA_HOME = '/usr/lib/jvm/java-8'
205+
SET_JAVA_HOME = "/usr/lib/jvm/java-11"
206+
// Activates hadoop 3.0 profile in maven runs.
207+
HADOOP_PROFILE = '3.0'
206208
OUTPUT_DIR_RELATIVE = "${env.OUTPUT_DIR_RELATIVE_GENERAL}"
207209
OUTPUT_DIR = "${env.WORKSPACE}/${env.OUTPUT_DIR_RELATIVE_GENERAL}"
208210
ASF_NIGHTLIES_GENERAL_CHECK_BASE="${ASF_NIGHTLIES_BASE}/${OUTPUT_DIR_RELATIVE}"

dev-support/Jenkinsfile_GitHub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ pipeline {
7878
environment {
7979
// customized per parallel stage
8080
PLUGINS = "${GENERAL_CHECK_PLUGINS}"
81-
SET_JAVA_HOME = '/usr/lib/jvm/java-8'
81+
SET_JAVA_HOME = "/usr/lib/jvm/java-11"
8282
WORKDIR_REL = "${WORKDIR_REL_GENERAL_CHECK}"
8383
// identical for all parallel stages
8484
WORKDIR = "${WORKSPACE}/${WORKDIR_REL}"

hbase-build-configuration/pom.xml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,6 @@
6868
<activation>
6969
<activeByDefault>false</activeByDefault>
7070
</activation>
71-
<properties>
72-
<!-- https://errorprone.info/docs/installation Maven section has details -->
73-
<!-- required when compiling with JDK 8 -->
74-
<javac.version>9+181-r4173-1</javac.version>
75-
</properties>
7671
<dependencies>
7772
<dependency>
7873
<groupId>com.google.errorprone</groupId>
@@ -86,12 +81,6 @@
8681
</exclusion>
8782
</exclusions>
8883
</dependency>
89-
<dependency>
90-
<groupId>com.google.errorprone</groupId>
91-
<artifactId>javac</artifactId>
92-
<version>${javac.version}</version>
93-
<scope>provided</scope>
94-
</dependency>
9584
</dependencies>
9685
<build>
9786
<plugins>
@@ -100,17 +89,12 @@
10089
<groupId>org.apache.maven.plugins</groupId>
10190
<artifactId>maven-compiler-plugin</artifactId>
10291
<configuration>
103-
<source>${compileSource}</source>
104-
<target>${compileSource}</target>
105-
<!-- required when compiling with JDK 8 -->
106-
<fork>true</fork>
92+
<release>${releaseTarget}</release>
10793
<showWarnings>true</showWarnings>
10894
<compilerArgs>
10995
<arg>-XDcompilePolicy=simple</arg>
11096
<!-- All -Xep need to be on single line see: https://github.com/google/error-prone/pull/1115 -->
111-
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:FallThrough:OFF -Xep:MutablePublicArray:OFF -Xep:ClassNewInstance:ERROR -Xep:MissingDefault:ERROR</arg>
112-
<!-- Required when compiling with JDK 8 -->
113-
<arg>-J-Xbootclasspath/p:${settings.localRepository}/com/google/errorprone/javac/${javac.version}/javac-${javac.version}.jar</arg>
97+
<arg>-Xplugin:ErrorProne -XepDisableWarningsInGeneratedCode -Xep:FallThrough:OFF -Xep:MutablePublicArray:OFF -Xep:ClassNewInstance:ERROR -Xep:MissingDefault:ERROR -Xep:BanJNDI:WARN</arg>
11498
</compilerArgs>
11599
<annotationProcessorPaths>
116100
<path>
@@ -121,6 +105,25 @@
121105
</annotationProcessorPaths>
122106
</configuration>
123107
</plugin>
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-enforcer-plugin</artifactId>
111+
<executions>
112+
<execution>
113+
<id>jdk11-required</id>
114+
<goals>
115+
<goal>enforce</goal>
116+
</goals>
117+
<configuration>
118+
<rules>
119+
<requireJavaVersion>
120+
<version>[11,)</version>
121+
</requireJavaVersion>
122+
</rules>
123+
</configuration>
124+
</execution>
125+
</executions>
126+
</plugin>
124127
</plugins>
125128
</build>
126129
</profile>

hbase-server/src/main/java/org/apache/hadoop/hbase/util/ServerCommandLine.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,17 @@
3636
import org.slf4j.Logger;
3737
import org.slf4j.LoggerFactory;
3838

39+
import org.apache.hbase.thirdparty.com.google.common.collect.ImmutableSet;
40+
3941
/**
4042
* Base class for command lines that start up various HBase daemons.
4143
*/
4244
@InterfaceAudience.Private
4345
public abstract class ServerCommandLine extends Configured implements Tool {
4446
private static final Logger LOG = LoggerFactory.getLogger(ServerCommandLine.class);
45-
@SuppressWarnings("serial")
46-
private static final Set<String> DEFAULT_SKIP_WORDS = new HashSet<String>() {
47-
{
48-
add("secret");
49-
add("passwd");
50-
add("password");
51-
add("credential");
52-
}
53-
};
47+
48+
private static final Set<String> DEFAULT_SKIP_WORDS =
49+
ImmutableSet.of("secret", "passwd", "password", "credential");
5450

5551
/**
5652
* Implementing subclasses should return a usage string to print out.

hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestScanner.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -542,14 +542,15 @@ public void testScanAndConcurrentMajorCompact() throws Exception {
542542
}
543543
}
544544

545-
/*
546-
* @param hri Region
545+
/**
546+
* Count table.
547+
* @param hri Region
547548
* @param flushIndex At what row we start the flush.
548549
* @param concurrent if the flush should be concurrent or sync.
549550
* @return Count of rows found.
550551
*/
551552
private int count(final Table countTable, final int flushIndex, boolean concurrent)
552-
throws IOException {
553+
throws Exception {
553554
LOG.info("Taking out counting scan");
554555
Scan scan = new Scan();
555556
for (byte[] qualifier : EXPLICIT_COLS) {
@@ -577,10 +578,10 @@ public void run() {
577578
}
578579
}
579580
};
580-
if (concurrent) {
581-
t.start(); // concurrently flush.
582-
} else {
583-
t.run(); // sync flush
581+
t.start();
582+
if (!concurrent) {
583+
// sync flush
584+
t.join();
584585
}
585586
LOG.info("Continuing on after kicking off background flush");
586587
justFlushed = true;

hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestNonHBaseReplicationEndpoint.java

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

2020
import java.io.IOException;
2121
import java.util.ArrayList;
22-
import java.util.HashMap;
23-
import java.util.List;
2422
import java.util.UUID;
2523
import java.util.concurrent.TimeUnit;
2624
import java.util.concurrent.atomic.AtomicBoolean;
@@ -45,6 +43,8 @@
4543
import org.junit.Test;
4644
import org.junit.experimental.categories.Category;
4745

46+
import org.apache.hbase.thirdparty.com.google.common.collect.ImmutableMap;
47+
4848
@Category({ MediumTests.class, ReplicationTests.class })
4949
public class TestNonHBaseReplicationEndpoint {
5050

@@ -86,11 +86,8 @@ public void test() throws IOException {
8686

8787
ReplicationPeerConfig peerConfig = ReplicationPeerConfig.newBuilder()
8888
.setReplicationEndpointImpl(NonHBaseReplicationEndpoint.class.getName())
89-
.setReplicateAllUserTables(false).setTableCFsMap(new HashMap<TableName, List<String>>() {
90-
{
91-
put(tableName, new ArrayList<>());
92-
}
93-
}).build();
89+
.setReplicateAllUserTables(false)
90+
.setTableCFsMap(ImmutableMap.of(tableName, new ArrayList<>())).build();
9491

9592
ADMIN.addReplicationPeer("1", peerConfig);
9693
loadData(table);

hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestBasicWALEntryStream.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,8 @@ public void testEOFExceptionForRecoveredQueue() throws Exception {
611611
localLogQueue.enqueueLog(emptyLog, fakeWalGroupId);
612612
ReplicationSourceWALReader reader = new ReplicationSourceWALReader(fs, conf, localLogQueue, 0,
613613
getDummyFilter(), source, fakeWalGroupId);
614-
reader.run();
614+
reader.start();
615+
reader.join();
615616
// ReplicationSourceWALReaderThread#handleEofException method will
616617
// remove empty log from logQueue.
617618
assertEquals(0, localLogQueue.getQueueSize(fakeWalGroupId));
@@ -650,7 +651,8 @@ public void testEOFExceptionForRecoveredQueueWithMultipleLogs() throws Exception
650651
getDummyFilter(), source, fakeWalGroupId);
651652
assertEquals("Initial log queue size is not correct", 2,
652653
localLogQueue.getQueueSize(fakeWalGroupId));
653-
reader.run();
654+
reader.start();
655+
reader.join();
654656

655657
// remove empty log from logQueue.
656658
assertEquals(0, localLogQueue.getQueueSize(fakeWalGroupId));

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@
840840
-->
841841
<checkstyle.version>8.29</checkstyle.version>
842842
<exec.maven.version>1.6.0</exec.maven.version>
843-
<error-prone.version>2.10.0</error-prone.version>
843+
<error-prone.version>2.16</error-prone.version>
844844
<jamon.plugin.version>2.4.2</jamon.plugin.version>
845845
<lifecycle.mapping.version>1.0.0</lifecycle.mapping.version>
846846
<maven.antrun.version>1.8</maven.antrun.version>

0 commit comments

Comments
 (0)