Browse Source

MINOR: Upgrade Scala for Java 20/21 support (#13840)

Upgrade to Scala 2.13.11 and Scala 2.12.18. A minor test change was required
to fix compilation with Scala 2.13.11.

Scala 2.13 release notes:
* https://github.com/scala/scala/releases/tag/v2.13.11

Scala 2.12 release notes:
* https://github.com/scala/scala/releases/tag/v2.12.16
* https://github.com/scala/scala/releases/tag/v2.12.17
* https://github.com/scala/scala/releases/tag/v2.12.18

Reviewers: Justine Olshan <jolshan@confluent.io>, Josep Prat <josep.prat@aiven.io>
pull/13891/head
Ismael Juma 1 year ago committed by GitHub
parent
commit
dfaae317b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      LICENSE-binary
  2. 2
      bin/kafka-run-class.sh
  3. 2
      bin/windows/kafka-run-class.bat
  4. 7
      core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala
  5. 2
      gradle.properties
  6. 4
      gradle/dependencies.gradle

4
LICENSE-binary

@ -253,9 +253,9 @@ plexus-utils-3.3.0 @@ -253,9 +253,9 @@ plexus-utils-3.3.0
reload4j-1.2.25
rocksdbjni-7.1.2
scala-collection-compat_2.13-2.10.0
scala-library-2.13.10
scala-library-2.13.11
scala-logging_2.13-3.9.4
scala-reflect-2.13.10
scala-reflect-2.13.11
scala-java8-compat_2.13-1.0.2
snappy-java-1.1.10.1
swagger-annotations-2.2.8

2
bin/kafka-run-class.sh

@ -48,7 +48,7 @@ should_include_file() { @@ -48,7 +48,7 @@ should_include_file() {
base_dir=$(dirname $0)/..
if [ -z "$SCALA_VERSION" ]; then
SCALA_VERSION=2.13.10
SCALA_VERSION=2.13.11
if [[ -f "$base_dir/gradle.properties" ]]; then
SCALA_VERSION=`grep "^scalaVersion=" "$base_dir/gradle.properties" | cut -d= -f 2`
fi

2
bin/windows/kafka-run-class.bat

@ -27,7 +27,7 @@ set BASE_DIR=%CD% @@ -27,7 +27,7 @@ set BASE_DIR=%CD%
popd
IF ["%SCALA_VERSION%"] EQU [""] (
set SCALA_VERSION=2.13.10
set SCALA_VERSION=2.13.11
)
IF ["%SCALA_BINARY_VERSION%"] EQU [""] (

7
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala

@ -2499,15 +2499,16 @@ class ReplicaManagerTest { @@ -2499,15 +2499,16 @@ class ReplicaManagerTest {
time: Time,
threadNamePrefix: Option[String],
replicationQuotaManager: ReplicationQuotaManager): ReplicaFetcherManager = {
new ReplicaFetcherManager(config, this, metrics, time, threadNamePrefix, replicationQuotaManager, () => metadataCache.metadataVersion(), () => 1) {
val rm = this
new ReplicaFetcherManager(config, rm, metrics, time, threadNamePrefix, replicationQuotaManager, () => metadataCache.metadataVersion(), () => 1) {
override def createFetcherThread(fetcherId: Int, sourceBroker: BrokerEndPoint): ReplicaFetcherThread = {
val logContext = new LogContext(s"[ReplicaFetcher replicaId=${config.brokerId}, leaderId=${sourceBroker.id}, " +
s"fetcherId=$fetcherId] ")
val fetchSessionHandler = new FetchSessionHandler(logContext, sourceBroker.id)
val leader = new RemoteLeaderEndPoint(logContext.logPrefix, blockingSend, fetchSessionHandler, config,
replicaManager, quotaManager.follower, () => config.interBrokerProtocolVersion, () => 1)
new ReplicaFetcherThread(s"ReplicaFetcherThread-$fetcherId", leader, config, failedPartitions, replicaManager,
rm, quotaManager.follower, () => config.interBrokerProtocolVersion, () => 1)
new ReplicaFetcherThread(s"ReplicaFetcherThread-$fetcherId", leader, config, failedPartitions, rm,
quotaManager.follower, logContext.logPrefix, () => config.interBrokerProtocolVersion) {
override def doWork(): Unit = {
// In case the thread starts before the partition is added by AbstractFetcherManager,

2
gradle.properties

@ -24,7 +24,7 @@ group=org.apache.kafka @@ -24,7 +24,7 @@ group=org.apache.kafka
# - streams/quickstart/java/src/main/resources/archetype-resources/pom.xml
# - streams/quickstart/java/pom.xml
version=3.6.0-SNAPSHOT
scalaVersion=2.13.10
scalaVersion=2.13.11
task=build
org.gradle.jvmargs=-Xmx2g -Xss4m -XX:+UseParallelGC
org.gradle.parallel=true

4
gradle/dependencies.gradle

@ -27,8 +27,8 @@ ext { @@ -27,8 +27,8 @@ ext {
}
// Add Scala version
def defaultScala212Version = '2.12.15'
def defaultScala213Version = '2.13.10'
def defaultScala212Version = '2.12.18'
def defaultScala213Version = '2.13.11'
if (hasProperty('scalaVersion')) {
if (scalaVersion == '2.12') {
versions["scala"] = defaultScala212Version

Loading…
Cancel
Save