-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-13273: Add support for Java 17 #11296
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
86b2083
MINOR: Replace Java 16 with Java 17 in Jenkins build
ijuma 58f98eb
Upgrade to Gradle 7.2
ijuma 4f4b1ab
Replace --illegal-access=permit with --add-opens
ijuma 0cc7483
Update readme
ijuma 052965a
Add back Java 16 temporarily
ijuma 861d406
Upgrade mockito
ijuma 61923c9
Open more packages and upgrade spotbugs gradle plugin
ijuma f1daef7
Open java.nio as well
ijuma 95d2a00
Open java.io
ijuma 494c1e5
Open more packages and remove most streams tests from test exclusion …
ijuma 67bd7e0
Update KafkaRaftClientTest so that we don't need private access to jd…
ijuma dfb80d2
Add note to notable changes
ijuma 16bd5c7
Tweak build comment
ijuma 607db6f
Revert spotbugs gradle plugin version bump
ijuma 9f1fdef
Add distributionSha256Sum back
ijuma 95f1dee
Remove Java 16 from Jenkinsfile since the build was green
ijuma 91116a2
Update release.py to use JDK 17
ijuma cbca40c
Fix QuorumStateTest failures
ijuma 4cc312b
Add comment explaining `--add-opens`
ijuma aebeac3
Wording improvement
ijuma c53f621
Remove unused method
ijuma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| distributionBase=GRADLE_USER_HOME | ||
| distributionPath=wrapper/dists | ||
| distributionSha256Sum=9bb8bc05f562f2d42bdf1ba8db62f6b6fa1c3bf6c392228802cc7cb0578fe7e0 | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-all.zip | ||
| distributionSha256Sum=a8da5b02437a60819cad23e10fc7e9cf32bcb57029d9cb277e26eeff76ce014b | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip | ||
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
raft/src/test/java/org/apache/kafka/raft/MockableRandom.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.kafka.raft; | ||
|
|
||
| import java.util.OptionalInt; | ||
| import java.util.Random; | ||
| import java.util.function.IntFunction; | ||
|
|
||
| /** | ||
| * A Random instance that makes it easy to modify the behavior of certain methods for test purposes. | ||
| */ | ||
| class MockableRandom extends Random { | ||
|
|
||
| private IntFunction<OptionalInt> nextIntFunction = __ -> OptionalInt.empty(); | ||
|
|
||
| public MockableRandom(long seed) { | ||
| super(seed); | ||
| } | ||
|
|
||
| public void mockNextInt(int expectedBound, int returnValue) { | ||
| this.nextIntFunction = b -> { | ||
| if (b == expectedBound) | ||
| return OptionalInt.of(returnValue); | ||
| else | ||
| return OptionalInt.empty(); | ||
| }; | ||
| } | ||
|
|
||
| public void mockNextInt(int returnValue) { | ||
| this.nextIntFunction = __ -> OptionalInt.of(returnValue); | ||
| } | ||
|
|
||
| @Override | ||
| public int nextInt(int bound) { | ||
| return nextIntFunction.apply(bound).orElse(super.nextInt(bound)); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.