Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(java11) - convert most modules to java 11 #5836

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
cc6b2c6
Merge pull request #1 from linkedin/master
leifker Mar 2, 2022
dc31cd3
Merge pull request #2 from linkedin/master
leifker Mar 8, 2022
4c9a760
Merge pull request #3 from linkedin/master
leifker Mar 10, 2022
4efc098
Merge pull request #4 from linkedin/master
leifker Mar 11, 2022
175cad1
Merge pull request #5 from linkedin/master
leifker Mar 14, 2022
0b58f4c
Merge pull request #6 from datahub-project/master
leifker Mar 16, 2022
ec29242
Merge branch 'datahub-project:master' into master
leifker Mar 23, 2022
2a14000
Merge branch 'datahub-project:master' into master
leifker Mar 31, 2022
f28eee7
Merge branch 'datahub-project:master' into master
leifker Apr 6, 2022
ed6f123
Merge branch 'datahub-project:master' into master
leifker Apr 8, 2022
ada7eb9
Merge branch 'datahub-project:master' into master
leifker Apr 14, 2022
d4f3719
Merge branch 'datahub-project:master' into master
leifker May 4, 2022
b32b9cb
Merge branch 'datahub-project:master' into master
leifker May 6, 2022
90f0e1d
Merge branch 'datahub-project:master' into master
leifker May 18, 2022
f5dd6fc
Merge branch 'datahub-project:master' into master
leifker Jul 18, 2022
702cc42
Merge branch 'datahub-project:master' into master
leifker Sep 3, 2022
e713606
Merge branch 'datahub-project:master' into master
leifker Sep 3, 2022
2ca1d47
refactor(java11) switch default jdk to 11
leifker Sep 6, 2022
154fb6a
Merge branch 'datahub-project:master' into master
leifker Sep 6, 2022
0aa6736
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 6, 2022
52f99ba
Merge branch 'datahub-project:master' into master
leifker Sep 6, 2022
de0bb5f
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 6, 2022
7319225
Merge branch 'datahub-project:master' into master
leifker Sep 7, 2022
cb2076d
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 7, 2022
2282455
Merge branch 'datahub-project:master' into master
leifker Sep 8, 2022
78750e2
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 8, 2022
3254252
Fix smoke test startup error
leifker Sep 8, 2022
ef3dfa3
Update spark lineaggolden_json browsePaths
leifker Sep 9, 2022
63a5cda
Merge branch 'datahub-project:master' into master
leifker Sep 9, 2022
16e75f1
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 9, 2022
265a591
Merge branch 'datahub-project:master' into master
leifker Sep 9, 2022
35b48e2
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 9, 2022
e6782e0
Merge branch 'datahub-project:master' into master
leifker Sep 9, 2022
6171219
Gradle max parallelization
leifker Sep 9, 2022
058d715
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 9, 2022
1f35ef2
metadata-io - tweak parallelization, helps with full build stability …
leifker Sep 11, 2022
ba9c6f1
Merge branch 'datahub-project:master' into master
leifker Sep 17, 2022
67b8976
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 17, 2022
a30a357
Remove gradle worker limit in metadata-io
leifker Sep 21, 2022
e4846ed
Merge branch 'datahub-project:master' into master
leifker Sep 21, 2022
60b13c5
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
leifker Sep 21, 2022
2cfbb1b
Merge remote-tracking branch 'origin/master' into dleifker/default_ja…
shirshanka Sep 25, 2022
fb4d40c
small edits to docs
shirshanka Sep 25, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-unified.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ jobs:
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.10"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/metadata-io.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-datahub-jars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spark-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- uses: actions/setup-python@v2
with:
python-version: "3.7"
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ MANIFEST
**/build
/config
*/i18n
/out
out/

# Mac OS
**/.DS_Store
Expand Down
43 changes: 9 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ buildscript {
classpath 'com.github.node-gradle:gradle-node-plugin:2.2.4'
classpath 'com.commercehub.gradle.plugin:gradle-avro-plugin:0.8.1'
classpath 'org.springframework.boot:spring-boot-gradle-plugin:' + springBootVersion
classpath('com.github.jengelman.gradle.plugins:shadow:5.2.0') {
exclude group: 'org.apache.logging.log4j', module: 'log4j-core'
}
classpath "io.codearte.gradle.nexus:gradle-nexus-staging-plugin:0.30.0"
classpath "com.palantir.gradle.gitversion:gradle-git-version:0.12.3"
classpath "org.gradle.playframework:gradle-playframework:0.12"
Expand All @@ -23,6 +20,7 @@ buildscript {

plugins {
id 'com.gorylenko.gradle-git-properties' version '2.4.0-rc2'
id 'com.github.johnrengelman.shadow' version '6.1.0'
}

project.ext.spec = [
Expand Down Expand Up @@ -171,7 +169,7 @@ allprojects {
apply plugin: 'checkstyle'
}

configure(subprojects.findAll {it.name != 'spark-lineage'}) {
configure(subprojects.findAll {! it.name.startsWith('spark-lineage') }) {

configurations.all {
exclude group: "io.netty", module: "netty"
Expand Down Expand Up @@ -221,37 +219,14 @@ subprojects {
}
}

if (project.name != 'datahub-protobuf') {
tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
} else {
tasks.withType(JavaExec).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(11)
}
tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
}
tasks.withType(Javadoc).configureEach {
javadocTool = javaToolchains.javadocToolFor {
languageVersion = JavaLanguageVersion.of(11)
}
}
tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(11)
}
}
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(11)
}
}
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(11)
}
}

Expand Down
1 change: 1 addition & 0 deletions docker/broker/env/docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
KAFKA_HEAP_OPTS=-Xms256m -Xmx256m
KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE=false
2 changes: 1 addition & 1 deletion docker/datahub-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FROM --platform=$BUILDPLATFORM node:16.13.0-alpine3.14 AS prod-build

# Upgrade Alpine and base packages
RUN apk --no-cache --update-cache --available upgrade \
&& apk --no-cache add perl openjdk8
&& apk --no-cache add perl openjdk8 openjdk11

ARG USE_SYSTEM_NODE="true"
ENV CI=true
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-gms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FROM --platform=$BUILDPLATFORM alpine:3.14 AS prod-build

# Upgrade Alpine and base packages
RUN apk --no-cache --update-cache --available upgrade \
&& apk --no-cache add openjdk8 perl
&& apk --no-cache add openjdk8 openjdk11 perl

COPY . /datahub-src
RUN cd /datahub-src && ./gradlew :metadata-service:war:build -x test
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-ingestion/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG APP_ENV=prod

FROM acryldata/datahub-ingestion-base as base

FROM openjdk:8 as prod-build
FROM openjdk:11 as prod-build
COPY . /datahub-src
RUN cd /datahub-src && ./gradlew :metadata-events:mxe-schemas:build

Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-mae-consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM --platform=$BUILDPLATFORM alpine:3.14.2 AS prod-build

# Upgrade Alpine and base packages
RUN apk --no-cache --update-cache --available upgrade \
&& apk --no-cache add openjdk8 perl
&& apk --no-cache add openjdk8 openjdk11 perl

COPY . datahub-src
RUN cd datahub-src && ./gradlew :metadata-jobs:mae-consumer-job:build -x test
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-mce-consumer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ FROM --platform=$BUILDPLATFORM alpine:3.14.2 AS prod-build

# Upgrade Alpine and base packages
RUN apk --no-cache --update-cache --available upgrade \
&& apk --no-cache add openjdk8 perl
&& apk --no-cache add openjdk8 openjdk11 perl

COPY . datahub-src
RUN cd datahub-src && ./gradlew :metadata-jobs:mce-consumer-job:build
Expand Down
2 changes: 1 addition & 1 deletion docker/datahub-upgrade/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ FROM --platform=$BUILDPLATFORM alpine:3.14 AS prod-build

# Upgrade Alpine and base packages
RUN apk --no-cache --update-cache --available upgrade \
&& apk --no-cache add openjdk8 perl
&& apk --no-cache add openjdk8 openjdk11 perl

COPY . datahub-src
RUN cd datahub-src && ./gradlew :datahub-upgrade:build
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-with-cassandra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- "2181:2181"
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper

broker:
image: confluentinc/cp-kafka:5.4.0
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose-without-neo4j.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- ${DATAHUB_MAPPED_ZK_PORT:-2181}:2181
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper

broker:
image: confluentinc/cp-kafka:5.4.0
Expand Down
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
ports:
- ${DATAHUB_MAPPED_ZK_PORT:-2181}:2181
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper

broker:
image: confluentinc/cp-kafka:5.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
- KAFKA_HEAP_OPTS=-Xms256m -Xmx256m
- KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE=false
hostname: broker
image: confluentinc/cp-kafka:7.2.0
ports:
Expand Down Expand Up @@ -176,7 +177,7 @@ services:
ports:
- ${DATAHUB_MAPPED_ZK_PORT:-2181}:2181
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper
version: '2.3'
volumes:
esdata: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
- KAFKA_HEAP_OPTS=-Xms256m -Xmx256m
- KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE=false
hostname: broker
image: confluentinc/cp-kafka:5.4.0
ports:
Expand Down Expand Up @@ -178,7 +179,7 @@ services:
ports:
- ${DATAHUB_MAPPED_ZK_PORT:-2181}:2181
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper
version: '2.3'
volumes:
esdata: null
Expand Down
3 changes: 2 additions & 1 deletion docker/quickstart/docker-compose.quickstart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1
- KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS=0
- KAFKA_HEAP_OPTS=-Xms256m -Xmx256m
- KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE=false
hostname: broker
image: confluentinc/cp-kafka:5.4.0
ports:
Expand Down Expand Up @@ -198,7 +199,7 @@ services:
ports:
- ${DATAHUB_MAPPED_ZK_PORT:-2181}:2181
volumes:
- zkdata:/var/opt/zookeeper
- zkdata:/var/lib/zookeeper
version: '2.3'
volumes:
broker: null
Expand Down
6 changes: 3 additions & 3 deletions docs/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ title: "Local Development"
# DataHub Developer's Guide

## Pre-requirements
- [Java 1.8 SDK](https://adoptopenjdk.net/?variant=openjdk8&jvmVariant=hotspot)
- [Java 11 SDK](https://openjdk.org/projects/jdk/11/)
- [Docker](https://www.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)
- Docker engine with at least 8GB of memory to run tests.

:::note

Do not try to use a JDK newer than JDK 8. The build process does not work with newer JDKs currently.
Do not try to use a JDK newer than JDK 11. The build process does not work with newer JDKs currently.

:::

Expand Down Expand Up @@ -101,7 +101,7 @@ You're probably using a Java version that's too new for gradle. Run the followin
```
java --version
```
While it may be possible to build and run DataHub using newer versions of Java, we currently only support [Java 1.8](https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html) (aka Java 8). Plan for Java 11 migration is being discussed in [this issue](https://github.com/datahub-project/datahub/issues/1699).
While it may be possible to build and run DataHub using newer versions of Java, we currently only support [Java 11](https://openjdk.org/projects/jdk/11/) (aka Java 11).

### Getting `cannot find symbol` error for `javax.annotation.Generated`

Expand Down
1 change: 1 addition & 0 deletions docs/how/updating-datahub.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file documents any backwards-incompatible changes in DataHub and assists pe
## Next

### Breaking Changes
- Java version 11 or greater is required.

### Potential Downtime

Expand Down
11 changes: 11 additions & 0 deletions li-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
apply plugin: 'java'
apply plugin: 'pegasus'

tasks.withType(JavaCompile).configureEach {
javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(8)
}
}
tasks.withType(Test).configureEach {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(8)
}
}

dependencies {
compile spec.product.pegasus.data
compile externalDependency.commonsLang
Expand Down
Loading