Skip to content

Commit

Permalink
Upgrade to java 21 (#678)
Browse files Browse the repository at this point in the history
* Upgrade built to java 21

* use corretto

* upgrade Mockito

* explicitly define bytebuddy definition

* use new fmt-maven-plugin version

* use com.spotify.fmt:fmt-maven-plugin

* whitespace

* comments

* bytebuddy
  • Loading branch information
vthacker authored Sep 22, 2023
1 parent 52db7e4 commit 8ca66cc
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ jobs:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'benchmark')
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
java-version: '21'
distribution: 'corretto'
cache: 'maven'
# - name: Download benchmark data
# # AWS cli can be used if we want to host separate data - https://stackoverflow.com/questions/59166099/github-action-aws-cli
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
java-version: '21'
# Currently, LTS versions of Eclipse Temurin (temurin) are cached on the GitHub Hosted Runners.
# When temurin releases Java 21 we can start using that again
distribution: 'corretto'
cache: 'maven'
- name: Ensure code is formatted
run: mvn -B -Dstyle.color=always com.spotify.fmt:fmt-maven-plugin:check --file kaldb/pom.xml
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM maven:3.9-amazoncorretto-17 as build
FROM maven:3.9-amazoncorretto-21 as build
COPY . /work/
RUN cd /work; mvn package -DskipTests

FROM amazoncorretto:17
FROM amazoncorretto:21
COPY --from=build /work/kaldb/target/kaldb.jar /
COPY --from=build /work/config/config.yaml /
ENTRYPOINT [ "java", "-jar", "./kaldb.jar", "config.yaml" ]
2 changes: 1 addition & 1 deletion benchmarks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.20</version>
<version>2.21.1</version>
<configuration>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
Expand Down
16 changes: 13 additions & 3 deletions kaldb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,13 @@
<version>3.24.2</version>
<scope>test</scope>
</dependency>
<!-- Note: next time we upgrade this, check if mockito-core depends on 1.14.8+ version of bytebuddy -->
<!-- if it does then we don't need to define bytebuddy explicitly anymore -->
<!-- Run mvn dependency:tree to verify. armeria also has a runtime dependency on bytebuddy so we need to check that as well -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.3.1</version>
<version>5.5.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -438,6 +441,13 @@
<version>5.2.0</version>
<scope>test</scope>
</dependency>
<!-- Define bytebuddy 1.14.8 explicitly which support Java 21 -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.14.8</version>
<scope>test</scope>
</dependency>

<!-- BlobFs test dependencies -->
<dependency>
Expand Down Expand Up @@ -572,7 +582,7 @@
<version>${error.prone.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -629,7 +639,7 @@
<plugin>
<groupId>com.spotify.fmt</groupId>
<artifactId>fmt-maven-plugin</artifactId>
<version>2.20</version>
<version>2.21.1</version>
<configuration>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/test/java</testSourceDirectory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ public void testConsumeMessagesBetweenOffsets() throws Exception {
// Assign doesn't create a consumer group.
assertThat(kafkaServer.getConnectedConsumerGroups()).isEqualTo(0);
}

// TODO: Test batch ingestion with roll over. Not adding a test, since this functionality is
// not needed by the recovery indexer yet.

Expand Down

0 comments on commit 8ca66cc

Please sign in to comment.