2014-02-08 05:48:04 +08:00
// 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
2015-07-09 01:22:42 +08:00
//
2014-02-08 05:48:04 +08:00
// http://www.apache.org/licenses/LICENSE-2.0
2015-07-09 01:22:42 +08:00
//
2014-02-08 05:48:04 +08:00
// 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.
2015-07-07 06:47:40 +08:00
import org.ajoberstar.grgit.Grgit
2023-02-27 16:28:19 +08:00
import org.gradle.api.JavaVersion
2015-07-07 06:47:40 +08:00
2019-02-16 02:50:08 +08:00
import java.nio.charset.StandardCharsets
2014-02-08 05:48:04 +08:00
buildscript {
repositories {
mavenCentral ( )
}
2019-05-02 10:20:12 +08:00
apply from: "$rootDir/gradle/dependencies.gradle"
2015-07-07 06:47:40 +08:00
dependencies {
2016-02-16 23:19:00 +08:00
// For Apache Rat plugin to ignore non-Git files
2019-05-02 10:20:12 +08:00
classpath "org.ajoberstar.grgit:grgit-core:$versions.grgit"
2018-07-10 07:48:34 +08:00
}
}
2021-03-05 03:22:22 +08:00
plugins {
2023-09-24 21:01:28 +08:00
id 'com.github.ben-manes.versions' version '0.48.0'
2021-03-05 03:22:22 +08:00
id 'idea'
2023-07-27 01:52:02 +08:00
id 'jacoco'
2021-03-25 11:19:28 +08:00
id 'java-library'
2023-04-26 05:31:04 +08:00
id 'org.owasp.dependencycheck' version '8.2.1'
2023-09-24 21:01:28 +08:00
id 'org.nosphere.apache.rat' version "0.8.1"
2023-10-09 18:30:46 +08:00
id "io.swagger.core.v3.swagger-gradle-plugin" version "${swaggerVersion}"
2021-03-05 03:22:22 +08:00
2025-04-07 10:27:36 +08:00
id "com.github.spotbugs" version '6.0.25' apply false
2024-03-14 17:36:46 +08:00
id 'org.scoverage' version '8.0.3' apply false
2024-09-18 03:05:25 +08:00
// Updating the shadow plugin version to 8.1.1 causes issue with signing and publishing the shadowed
// artifacts - see https://github.com/johnrengelman/shadow/issues/901
id 'com.github.johnrengelman.shadow' version '8.1.0' apply false
2024-06-05 18:57:32 +08:00
// Spotless 6.13.0 has issue with Java 21 (see https://github.com/diffplug/spotless/pull/1920), and Spotless 6.14.0+ requires JRE 11
// We are going to drop JDK8 support. Hence, the spotless is upgrade to newest version and be applied only if the build env is compatible with JDK 11.
// spotless 6.15.0+ has issue in runtime with JDK8 even through we define it with `apply:false`. see https://github.com/diffplug/spotless/issues/2156 for more details
id 'com.diffplug.spotless' version "6.14.0" apply false
2014-02-08 05:48:04 +08:00
}
2014-09-24 00:06:17 +08:00
ext {
2020-04-20 10:24:21 +08:00
gradleVersion = versions . gradle
2023-02-24 11:13:43 +08:00
minJavaVersion = 8
2016-01-09 07:13:14 +08:00
buildVersionFileName = "kafka-version.properties"
2014-09-24 00:06:17 +08:00
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
defaultMaxHeapSize = "2g"
defaultJvmArgs = [ "-Xss4m" , "-XX:+UseParallelGC" ]
2022-02-09 04:43:45 +08:00
2021-09-06 23:55:52 +08:00
// "JEP 403: Strongly Encapsulate JDK Internals" causes some tests to fail when they try
// to access internals (often via mocking libraries). We use `--add-opens` as a workaround
// for now and we'll fix it properly (where possible) via KAFKA-13275.
if ( JavaVersion . current ( ) . isCompatibleWith ( JavaVersion . VERSION_16 ) )
defaultJvmArgs . addAll (
"--add-opens=java.base/java.io=ALL-UNNAMED" ,
2022-07-26 20:58:50 +08:00
"--add-opens=java.base/java.lang=ALL-UNNAMED" ,
2021-09-06 23:55:52 +08:00
"--add-opens=java.base/java.nio=ALL-UNNAMED" ,
"--add-opens=java.base/java.nio.file=ALL-UNNAMED" ,
2022-07-26 20:58:50 +08:00
"--add-opens=java.base/java.util=ALL-UNNAMED" ,
2021-09-06 23:55:52 +08:00
"--add-opens=java.base/java.util.concurrent=ALL-UNNAMED" ,
"--add-opens=java.base/java.util.regex=ALL-UNNAMED" ,
"--add-opens=java.base/java.util.stream=ALL-UNNAMED" ,
"--add-opens=java.base/java.text=ALL-UNNAMED" ,
"--add-opens=java.base/java.time=ALL-UNNAMED" ,
"--add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED"
)
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
2022-02-09 03:03:19 +08:00
maxTestForks = project . hasProperty ( 'maxParallelForks' ) ? maxParallelForks . toInteger ( ) : Runtime . runtime . availableProcessors ( )
2022-05-12 14:51:27 +08:00
maxScalacThreads = project . hasProperty ( 'maxScalacThreads' ) ? maxScalacThreads . toInteger ( ) :
2022-02-09 03:03:19 +08:00
Math . min ( Runtime . runtime . availableProcessors ( ) , 8 )
2020-09-02 06:12:10 +08:00
userIgnoreFailures = project . hasProperty ( 'ignoreFailures' ) ? ignoreFailures : false
2015-10-13 09:26:38 +08:00
2020-02-06 08:41:28 +08:00
userMaxTestRetries = project . hasProperty ( 'maxTestRetries' ) ? maxTestRetries . toInteger ( ) : 0
userMaxTestRetryFailures = project . hasProperty ( 'maxTestRetryFailures' ) ? maxTestRetryFailures . toInteger ( ) : 0
2016-01-09 07:13:14 +08:00
skipSigning = project . hasProperty ( 'skipSigning' ) & & skipSigning . toBoolean ( )
2021-03-05 03:22:22 +08:00
shouldSign = ! skipSigning & & ! version . endsWith ( "SNAPSHOT" )
2016-01-09 07:13:14 +08:00
mavenUrl = project . hasProperty ( 'mavenUrl' ) ? project . mavenUrl : ''
mavenUsername = project . hasProperty ( 'mavenUsername' ) ? project . mavenUsername : ''
mavenPassword = project . hasProperty ( 'mavenPassword' ) ? project . mavenPassword : ''
userShowStandardStreams = project . hasProperty ( "showStandardStreams" ) ? showStandardStreams : null
2015-05-30 05:50:45 +08:00
2016-06-03 17:30:01 +08:00
userTestLoggingEvents = project . hasProperty ( "testLoggingEvents" ) ? Arrays . asList ( testLoggingEvents . split ( "," ) ) : null
2020-06-19 22:32:53 +08:00
userEnableTestCoverage = project . hasProperty ( "enableTestCoverage" ) ? enableTestCoverage : false
MINOR: Reuse gradle daemon for scala compilation by default (#12280)
The time time to compile was reduced from 5.3 seconds to 0.9 seconds by
changing the keep alive mode from `SESSION` to `DAEMON`. We change the
default to the latter and allow the former to be set via a `keepAliveMode`
property.
Also update the Jenkins build to use `keepAliveMode="session"` instead of
`--no-daemon`.
./gradlew compileTestScala -PkeepAliveMode="daemon" --info:
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.004 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 0.925 secs
./gradlew compileTestScala -PkeepAliveMode="session" --info
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Starting process 'Gradle Worker Daemon 3'. Working directory: /home/ijuma/.gradle/workers Command: /usr/java/jdk-17.0.4.1+1/bin/java -Xss4m -XX:+UseParallelGC --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED @/home/ijuma/.gradle/.tmp/gradle-worker-classpath3305983246500958050txt -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Worker Daemon 3'
> Successfully started process 'Gradle Worker Daemon 3'
> Started Gradle worker daemon (0.244 secs) with fork options DaemonForkOptions{executable=/usr/java/jdk-17.0.4.1+1/bin/java, minHeapSize=null, maxHeapSize=2048m, jvmArgs=[-Xss4m, -XX:+UseParallelGC, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/java.nio.file=ALL-UNNAMED, --add-opens=java.base/java.util=ALL-UNNAMED, --add-opens=java.base/java.util.concurrent=ALL-UNNAMED, --add-opens=java.base/java.util.regex=ALL-UNNAMED, --add-opens=java.base/java.util.stream=ALL-UNNAMED, --add-opens=java.base/java.text=ALL-UNNAMED, --add-opens=java.base/java.time=ALL-UNNAMED, --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED], keepAliveMode=SESSION}.
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.187 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 5.307 secs
See https://github.com/gradle/gradle/issues/20579 for more details.
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-12-01 21:33:43 +08:00
userKeepAliveModeString = project . hasProperty ( "keepAliveMode" ) ? keepAliveMode : "daemon"
userKeepAliveMode = KeepAliveMode . values ( ) . find ( m - > m . name ( ) . toLowerCase ( ) . equals ( userKeepAliveModeString ) )
if ( userKeepAliveMode = = null ) {
def keepAliveValues = KeepAliveMode . values ( ) . collect ( m - > m . name . toLowerCase ( ) )
throw new GradleException ( "Unexpected value for keepAliveMode property. Expected one of $keepAliveValues, but received: $userKeepAliveModeString" )
}
2021-02-23 13:11:17 +08:00
// See README.md for details on this option and the reasoning for the default
userScalaOptimizerMode = project . hasProperty ( "scalaOptimizerMode" ) ? scalaOptimizerMode : "inline-kafka"
def scalaOptimizerValues = [ "none" , "method" , "inline-kafka" , "inline-scala" ]
if ( ! scalaOptimizerValues . contains ( userScalaOptimizerMode ) )
MINOR: Reuse gradle daemon for scala compilation by default (#12280)
The time time to compile was reduced from 5.3 seconds to 0.9 seconds by
changing the keep alive mode from `SESSION` to `DAEMON`. We change the
default to the latter and allow the former to be set via a `keepAliveMode`
property.
Also update the Jenkins build to use `keepAliveMode="session"` instead of
`--no-daemon`.
./gradlew compileTestScala -PkeepAliveMode="daemon" --info:
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.004 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 0.925 secs
./gradlew compileTestScala -PkeepAliveMode="session" --info
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Starting process 'Gradle Worker Daemon 3'. Working directory: /home/ijuma/.gradle/workers Command: /usr/java/jdk-17.0.4.1+1/bin/java -Xss4m -XX:+UseParallelGC --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED @/home/ijuma/.gradle/.tmp/gradle-worker-classpath3305983246500958050txt -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Worker Daemon 3'
> Successfully started process 'Gradle Worker Daemon 3'
> Started Gradle worker daemon (0.244 secs) with fork options DaemonForkOptions{executable=/usr/java/jdk-17.0.4.1+1/bin/java, minHeapSize=null, maxHeapSize=2048m, jvmArgs=[-Xss4m, -XX:+UseParallelGC, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/java.nio.file=ALL-UNNAMED, --add-opens=java.base/java.util=ALL-UNNAMED, --add-opens=java.base/java.util.concurrent=ALL-UNNAMED, --add-opens=java.base/java.util.regex=ALL-UNNAMED, --add-opens=java.base/java.util.stream=ALL-UNNAMED, --add-opens=java.base/java.text=ALL-UNNAMED, --add-opens=java.base/java.time=ALL-UNNAMED, --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED], keepAliveMode=SESSION}.
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.187 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 5.307 secs
See https://github.com/gradle/gradle/issues/20579 for more details.
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-12-01 21:33:43 +08:00
throw new GradleException ( "Unexpected value for scalaOptimizerMode property. Expected one of $scalaOptimizerValues, but received: $userScalaOptimizerMode" )
2021-02-23 13:11:17 +08:00
2016-03-10 13:13:54 +08:00
generatedDocsDir = new File ( "${project.rootDir}/docs/generated" )
2023-10-23 02:08:01 +08:00
repo = file ( "$rootDir/.git" ) . isDirectory ( ) ? Grgit . open ( currentDir: project . getRootDir ( ) ) : null
2017-08-04 06:24:05 +08:00
2022-02-09 03:03:19 +08:00
commitId = determineCommitId ( )
2024-04-17 19:06:07 +08:00
addParametersForTests = { name , options - >
// -parameters generates arguments with parameter names in TestInfo#getDisplayName.
// ref: https://github.com/junit-team/junit5/blob/4c0dddad1b96d4a20e92a2cd583954643ac56ac0/junit-jupiter-params/src/main/java/org/junit/jupiter/params/ParameterizedTest.java#L161-L164
if ( name = = "compileTestJava" | | name = = "compileTestScala" )
options . compilerArgs < < "-parameters"
}
2022-02-09 03:03:19 +08:00
}
2022-02-09 04:43:45 +08:00
allprojects {
repositories {
mavenCentral ( )
}
dependencyUpdates {
revision = "release"
resolutionStrategy {
componentSelection { rules - >
rules . all { ComponentSelection selection - >
boolean rejected = [ 'snap' , 'alpha' , 'beta' , 'rc' , 'cr' , 'm' ] . any { qualifier - >
selection . candidate . version = = ~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if ( rejected ) {
selection . reject ( 'Release candidate' )
}
}
}
}
}
configurations . all {
// zinc is the Scala incremental compiler, it has a configuration for its own dependencies
// that are unrelated to the project dependencies, we should not change them
if ( name ! = "zinc" ) {
resolutionStrategy {
force (
// be explicit about the javassist dependency version instead of relying on the transitive version
libs . javassist ,
// ensure we have a single version in the classpath despite transitive dependencies
libs . scalaLibrary ,
libs . scalaReflect ,
libs . jacksonAnnotations ,
// be explicit about the Netty dependency version instead of relying on the version set by
// ZooKeeper (potentially older and containing CVEs)
libs . nettyHandler ,
2023-05-24 09:32:59 +08:00
libs . nettyTransportNativeEpoll ,
2024-08-17 03:53:13 +08:00
// be explicit about the reload4j version instead of relying on the transitive versions
libs . reload4j
2022-02-09 04:43:45 +08:00
)
}
}
}
2022-03-31 02:54:01 +08:00
task printAllDependencies ( type: DependencyReportTask ) { }
2024-05-22 04:54:11 +08:00
tasks . withType ( Javadoc ) {
options . charSet = 'UTF-8'
options . docEncoding = 'UTF-8'
options . encoding = 'UTF-8'
options . memberLevel = JavadocMemberLevel . PUBLIC // Document only public members/API
// Turn off doclint for now, see https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html for rationale
options . addStringOption ( 'Xdoclint:none' , '-quiet' )
2024-06-01 01:31:08 +08:00
// Javadoc warnings should fail the build in JDK 15+ https://bugs.openjdk.org/browse/JDK-8200363
options . addBooleanOption ( 'Werror' , JavaVersion . current ( ) . isCompatibleWith ( JavaVersion . VERSION_15 ) )
2024-05-22 04:54:11 +08:00
// The URL structure was changed to include the locale after Java 8
if ( JavaVersion . current ( ) . isJava11Compatible ( ) )
options . links "https://docs.oracle.com/en/java/javase/${JavaVersion.current().majorVersion}/docs/api/"
else
options . links "https://docs.oracle.com/javase/8/docs/api/"
}
2022-02-09 04:43:45 +08:00
}
2022-02-09 03:03:19 +08:00
def determineCommitId ( ) {
def takeFromHash = 16
2022-04-08 23:55:52 +08:00
if ( project . hasProperty ( 'commitId' ) ) {
commitId . take ( takeFromHash )
2023-10-23 02:08:01 +08:00
} else if ( repo ! = null ) {
repo . head ( ) . id . take ( takeFromHash )
2022-02-09 03:03:19 +08:00
} else {
"unknown"
}
2014-09-21 06:43:51 +08:00
}
2024-06-20 17:43:25 +08:00
2024-06-03 04:02:07 +08:00
2014-09-24 00:06:17 +08:00
apply from: file ( 'wrapper.gradle' )
2015-07-07 06:47:40 +08:00
2023-10-23 02:08:01 +08:00
if ( repo ! = null ) {
2015-11-11 02:17:13 +08:00
rat {
2023-06-17 00:38:43 +08:00
dependsOn subprojects . collect {
it . tasks . matching {
it . name = = "processMessages" | | it . name = = "processTestMessages"
}
}
2022-10-25 18:50:59 +08:00
verbose . set ( true )
2021-04-13 12:05:49 +08:00
reportDir . set ( project . file ( 'build/rat' ) )
stylesheet . set ( file ( 'gradle/resources/rat-output-to-html.xsl' ) )
2015-11-11 02:17:13 +08:00
// Exclude everything under the directory that git should be ignoring via .gitignore or that isn't checked in. These
// restrict us only to files that are checked in or are staged.
excludes = new ArrayList < String > ( repo . clean ( ignore: false , directories: true , dryRun: true ) )
// And some of the files that we have checked in should also be excluded from this check
excludes . addAll ( [
'**/.git/**' ,
'**/build/**' ,
'CONTRIBUTING.md' ,
2017-11-10 18:41:15 +08:00
'PULL_REQUEST_TEMPLATE.md' ,
2015-11-11 02:17:13 +08:00
'gradlew' ,
'gradlew.bat' ,
2019-11-25 02:51:49 +08:00
'gradle/wrapper/gradle-wrapper.properties' ,
2023-07-11 00:11:21 +08:00
'trogdor/README.md' ,
2017-01-09 08:14:16 +08:00
'**/README.md' ,
'**/id_rsa' ,
2017-03-01 06:55:46 +08:00
'**/id_rsa.pub' ,
2017-08-12 03:19:28 +08:00
'checkstyle/suppressions.xml' ,
2018-04-24 04:33:35 +08:00
'streams/quickstart/java/src/test/resources/projects/basic/goal.txt' ,
2019-11-22 02:51:55 +08:00
'streams/streams-scala/logs/*' ,
2021-04-07 04:08:24 +08:00
'licenses/*' ,
2021-04-13 12:05:49 +08:00
'**/generated/**' ,
2023-12-06 18:29:13 +08:00
'clients/src/test/resources/serializedData/*' ,
2023-12-12 12:59:05 +08:00
'docker/test/fixtures/secrets/*' ,
2024-05-25 00:51:02 +08:00
'docker/examples/fixtures/secrets/*' ,
'docker/docker_official_images/.gitkeep'
2015-11-11 02:17:13 +08:00
] )
}
2021-04-13 12:05:49 +08:00
} else {
rat . enabled = false
2015-07-07 06:47:40 +08:00
}
2022-03-24 11:09:05 +08:00
println ( "Starting build with version $version (commit id ${commitId == null ? " null " : commitId.take(8)}) using Gradle $gradleVersion, Java ${JavaVersion.current()} and Scala ${versions.scala}" )
2022-02-09 03:03:19 +08:00
println ( "Build properties: maxParallelForks=$maxTestForks, maxScalacThreads=$maxScalacThreads, maxTestRetries=$userMaxTestRetries" )
2019-02-16 02:50:08 +08:00
2014-02-08 05:48:04 +08:00
subprojects {
2019-11-16 17:08:35 +08:00
// enable running :dependencies task recursively on all subprojects
// eg: ./gradlew allDeps
task allDeps ( type: DependencyReportTask ) { }
// enable running :dependencyInsight task recursively on all subprojects
// eg: ./gradlew allDepInsight --configuration runtime --dependency com.fasterxml.jackson.core:jackson-databind
2022-10-25 21:09:53 +08:00
task allDepInsight ( type: DependencyInsightReportTask ) { showingAllVariants = false } doLast { }
2019-11-16 17:08:35 +08:00
2021-03-05 03:22:22 +08:00
apply plugin: 'java-library'
apply plugin: 'checkstyle'
2023-10-12 20:09:10 +08:00
apply plugin: "com.github.spotbugs"
2021-03-05 03:22:22 +08:00
// We use the shadow plugin for the jmh-benchmarks module and the `-all` jar can get pretty large, so
// don't publish it
def shouldPublish = ! project . name . equals ( 'jmh-benchmarks' )
2023-11-02 12:53:24 +08:00
def shouldPublishWithShadow = ( [ 'clients' ] . contains ( project . name ) )
2021-03-05 03:22:22 +08:00
if ( shouldPublish ) {
apply plugin: 'maven-publish'
apply plugin: 'signing'
// Add aliases for the task names used by the maven plugin for backwards compatibility
// The maven plugin was replaced by the maven-publish plugin in Gradle 7.0
tasks . register ( 'install' ) . configure { dependsOn ( publishToMavenLocal ) }
tasks . register ( 'uploadArchives' ) . configure { dependsOn ( publish ) }
}
2017-02-10 10:37:32 +08:00
// apply the eclipse plugin only to subprojects that hold code. 'connect' is just a folder.
if ( ! project . name . equals ( 'connect' ) ) {
apply plugin: 'eclipse'
fineTuneEclipseClasspathFile ( eclipse , project )
}
2014-02-15 03:15:32 +08:00
2021-01-20 00:12:26 +08:00
java {
consistentResolution {
// resolve the compileClasspath and then "inject" the result of resolution as strict constraints into the runtimeClasspath
useCompileClasspathVersions ( )
}
}
2018-11-13 14:18:59 +08:00
tasks . withType ( JavaCompile ) {
2016-03-15 10:14:36 +08:00
options . encoding = 'UTF-8'
2018-11-13 14:18:59 +08:00
options . compilerArgs < < "-Xlint:all"
// temporary exclusions until all the warnings are fixed
2024-05-07 07:49:35 +08:00
if ( ! project . path . startsWith ( ":connect" ) & & ! project . path . startsWith ( ":storage" ) )
2021-07-08 00:24:31 +08:00
options . compilerArgs < < "-Xlint:-rawtypes"
2018-11-13 14:18:59 +08:00
options . compilerArgs < < "-Xlint:-serial"
options . compilerArgs < < "-Xlint:-try"
options . compilerArgs < < "-Werror"
2023-02-24 11:13:43 +08:00
2017-08-19 15:55:29 +08:00
// --release is the recommended way to select the target release, but it's only supported in Java 9 so we also
2023-02-24 11:13:43 +08:00
// set --source and --target via `sourceCompatibility` and `targetCompatibility` a couple of lines below
2017-08-19 15:55:29 +08:00
if ( JavaVersion . current ( ) . isJava9Compatible ( ) )
2023-02-24 11:13:43 +08:00
options . release = minJavaVersion
2023-06-30 16:12:00 +08:00
// --source/--target 8 is deprecated in Java 20, suppress warning until Java 8 support is dropped in Kafka 4.0
if ( JavaVersion . current ( ) . isCompatibleWith ( JavaVersion . VERSION_20 ) )
options . compilerArgs < < "-Xlint:-options"
2023-05-13 09:32:11 +08:00
2024-04-17 19:06:07 +08:00
addParametersForTests ( name , options )
}
2024-04-06 10:43:22 +08:00
2024-05-31 03:11:35 +08:00
java {
// We should only set this if Java version is < 9 (--release is recommended for >= 9), but the Scala plugin for IntelliJ sets
// `-target` incorrectly if this is unset
sourceCompatibility = minJavaVersion
targetCompatibility = minJavaVersion
}
2016-03-15 10:14:36 +08:00
2021-03-05 03:22:22 +08:00
if ( shouldPublish ) {
publishing {
repositories {
// To test locally, invoke gradlew with `-PmavenUrl=file:///some/local/path`
maven {
url = mavenUrl
credentials {
username = mavenUsername
password = mavenPassword
}
}
}
publications {
mavenJava ( MavenPublication ) {
2023-11-02 12:53:24 +08:00
if ( ! shouldPublishWithShadow ) {
from components . java
} else {
2024-09-18 03:05:25 +08:00
apply plugin: 'com.github.johnrengelman.shadow'
2024-02-03 01:32:03 +08:00
project . shadow . component ( mavenJava )
2024-04-04 17:56:08 +08:00
// Fix for avoiding inclusion of runtime dependencies marked as 'shadow' in MANIFEST Class-Path.
// https://github.com/johnrengelman/shadow/issues/324
afterEvaluate {
pom . withXml { xml - >
if ( xml . asNode ( ) . get ( 'dependencies' ) = = null ) {
xml . asNode ( ) . appendNode ( 'dependencies' )
}
def dependenciesNode = xml . asNode ( ) . get ( 'dependencies' ) . get ( 0 )
project . configurations . shadowed . allDependencies . each {
def dependencyNode = dependenciesNode . appendNode ( 'dependency' )
dependencyNode . appendNode ( 'groupId' , it . group )
dependencyNode . appendNode ( 'artifactId' , it . name )
dependencyNode . appendNode ( 'version' , it . version )
dependencyNode . appendNode ( 'scope' , 'runtime' )
}
}
}
2023-11-02 12:53:24 +08:00
}
2021-03-05 03:22:22 +08:00
afterEvaluate {
[ "srcJar" , "javadocJar" , "scaladocJar" , "testJar" , "testSrcJar" ] . forEach { taskName - >
def task = tasks . findByName ( taskName )
if ( task ! = null )
artifact task
}
2024-05-24 01:15:56 +08:00
artifactId = base . archivesName . get ( )
2021-03-05 03:22:22 +08:00
pom {
name = 'Apache Kafka'
url = 'https://kafka.apache.org'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
2014-02-08 05:48:04 +08:00
}
2021-03-05 03:22:22 +08:00
}
2014-02-08 05:48:04 +08:00
}
2021-03-05 03:22:22 +08:00
}
}
}
if ( shouldSign ) {
signing {
sign publishing . publications . mavenJava
2014-02-08 05:48:04 +08:00
}
}
}
2017-03-21 17:55:46 +08:00
def testLoggingEvents = [ "passed" , "skipped" , "failed" ]
def testShowStandardStreams = false
def testExceptionFormat = 'full'
2019-02-16 02:50:08 +08:00
// Gradle built-in logging only supports sending test output to stdout, which generates a lot
// of noise, especially for passing tests. We really only want output for failed tests. This
// hooks into the output and logs it (so we don't have to buffer it all in memory) and only
// saves the output for failing tests. Directory and filenames are such that you can, e.g.,
// create a Jenkins rule to collect failed test output.
def logTestStdout = {
def testId = { TestDescriptor descriptor - >
"${descriptor.className}.${descriptor.name}" . toString ( )
}
def logFiles = new HashMap < String , File > ( )
def logStreams = new HashMap < String , FileOutputStream > ( )
beforeTest { TestDescriptor td - >
def tid = testId ( td )
2020-04-29 04:57:11 +08:00
// truncate the file name if it's too long
2019-02-16 02:50:08 +08:00
def logFile = new File (
2020-04-29 04:57:11 +08:00
"${projectDir}/build/reports/testOutput/${tid.substring(0, Math.min(tid.size(),240))}.test.stdout"
)
2019-02-16 02:50:08 +08:00
logFile . parentFile . mkdirs ( )
logFiles . put ( tid , logFile )
logStreams . put ( tid , new FileOutputStream ( logFile ) )
}
onOutput { TestDescriptor td , TestOutputEvent toe - >
def tid = testId ( td )
// Some output can happen outside the context of a specific test (e.g. at the class level)
// and beforeTest/afterTest seems to not be invoked for these cases (and similarly, there's
// a TestDescriptor hierarchy that includes the thread executing the test, Gradle tasks,
// etc). We see some of these in practice and it seems like something buggy in the Gradle
// test runner since we see it *before* any tests and it is frequently not related to any
// code in the test (best guess is that it is tail output from last test). We won't have
// an output file for these, so simply ignore them. If they become critical for debugging,
// they can be seen with showStandardStreams.
2020-02-27 01:10:00 +08:00
if ( td . name = = td . className | | td . className = = null ) {
// silently ignore output unrelated to specific test methods
return
} else if ( logStreams . get ( tid ) = = null ) {
println "WARNING: unexpectedly got output for a test [${tid}]" +
" that we didn't previously see in the beforeTest hook." +
" Message for debugging: [" + toe . message + "]."
2019-02-16 02:50:08 +08:00
return
}
try {
logStreams . get ( tid ) . write ( toe . message . getBytes ( StandardCharsets . UTF_8 ) )
} catch ( Exception e ) {
println "ERROR: Failed to write output for test ${tid}"
e . printStackTrace ( )
}
}
afterTest { TestDescriptor td , TestResult tr - >
def tid = testId ( td )
try {
logStreams . get ( tid ) . close ( )
if ( tr . resultType ! = TestResult . ResultType . FAILURE ) {
logFiles . get ( tid ) . delete ( )
} else {
def file = logFiles . get ( tid )
println "${tid} failed, log available in ${file}"
}
} catch ( Exception e ) {
println "ERROR: Failed to close stdout file for ${tid}"
e . printStackTrace ( )
} finally {
logFiles . remove ( tid )
logStreams . remove ( tid )
}
}
}
2017-03-21 17:55:46 +08:00
2021-06-13 23:14:37 +08:00
// The suites are for running sets of tests in IDEs.
// Gradle will run each test class, so we exclude the suites to avoid redundantly running the tests twice.
def testsToExclude = [ '**/*Suite.class' ]
2016-01-07 08:19:39 +08:00
test {
2022-02-09 03:03:19 +08:00
maxParallelForks = maxTestForks
2020-09-02 06:12:10 +08:00
ignoreFailures = userIgnoreFailures
2016-09-29 10:15:00 +08:00
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
maxHeapSize = defaultMaxHeapSize
jvmArgs = defaultJvmArgs
2016-09-29 10:15:00 +08:00
2016-01-07 08:19:39 +08:00
testLogging {
2017-03-21 17:55:46 +08:00
events = userTestLoggingEvents ? : testLoggingEvents
showStandardStreams = userShowStandardStreams ? : testShowStandardStreams
exceptionFormat = testExceptionFormat
2022-09-19 09:24:27 +08:00
displayGranularity = 0
2017-03-21 17:55:46 +08:00
}
2019-02-16 02:50:08 +08:00
logTestStdout . rehydrate ( delegate , owner , this ) ( )
2020-02-06 08:41:28 +08:00
2021-06-13 23:14:37 +08:00
exclude testsToExclude
2020-03-30 11:28:57 +08:00
2024-06-27 15:11:32 +08:00
useJUnitPlatform {
includeEngines 'junit-jupiter'
}
2020-09-11 07:14:38 +08:00
2020-02-06 08:41:28 +08:00
retry {
maxRetries = userMaxTestRetries
maxFailures = userMaxTestRetryFailures
}
2017-03-21 17:55:46 +08:00
}
task integrationTest ( type: Test , dependsOn: compileJava ) {
2022-02-09 03:03:19 +08:00
maxParallelForks = maxTestForks
2020-09-02 06:12:10 +08:00
ignoreFailures = userIgnoreFailures
2017-03-21 17:55:46 +08:00
2022-05-19 03:08:36 +08:00
// Increase heap size for integration tests
maxHeapSize = "2560m"
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
jvmArgs = defaultJvmArgs
2017-03-21 17:55:46 +08:00
testLogging {
events = userTestLoggingEvents ? : testLoggingEvents
showStandardStreams = userShowStandardStreams ? : testShowStandardStreams
exceptionFormat = testExceptionFormat
2022-09-19 09:24:27 +08:00
displayGranularity = 0
2017-03-21 17:55:46 +08:00
}
2019-02-16 02:50:08 +08:00
logTestStdout . rehydrate ( delegate , owner , this ) ( )
2017-09-14 01:18:54 +08:00
2021-06-13 23:14:37 +08:00
exclude testsToExclude
2020-03-30 11:28:57 +08:00
2024-06-27 15:11:32 +08:00
useJUnitPlatform {
includeTags "integration"
includeEngines 'junit-jupiter'
2016-01-07 08:19:39 +08:00
}
2017-09-14 01:18:54 +08:00
2020-03-22 00:09:29 +08:00
retry {
maxRetries = userMaxTestRetries
maxFailures = userMaxTestRetryFailures
}
2017-03-21 17:55:46 +08:00
}
2016-09-29 10:15:00 +08:00
2017-03-21 17:55:46 +08:00
task unitTest ( type: Test , dependsOn: compileJava ) {
2022-02-09 03:03:19 +08:00
maxParallelForks = maxTestForks
2020-09-02 06:12:10 +08:00
ignoreFailures = userIgnoreFailures
2017-03-21 17:55:46 +08:00
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
maxHeapSize = defaultMaxHeapSize
jvmArgs = defaultJvmArgs
2017-03-21 17:55:46 +08:00
testLogging {
events = userTestLoggingEvents ? : testLoggingEvents
showStandardStreams = userShowStandardStreams ? : testShowStandardStreams
exceptionFormat = testExceptionFormat
2022-09-19 09:24:27 +08:00
displayGranularity = 0
2017-03-21 17:55:46 +08:00
}
2019-02-16 02:50:08 +08:00
logTestStdout . rehydrate ( delegate , owner , this ) ( )
2021-04-16 02:37:15 +08:00
2021-06-13 23:14:37 +08:00
exclude testsToExclude
2017-09-14 01:18:54 +08:00
2024-06-27 15:11:32 +08:00
useJUnitPlatform {
excludeTags "integration"
includeEngines 'junit-jupiter'
2017-03-21 17:55:46 +08:00
}
2020-03-22 00:09:29 +08:00
retry {
maxRetries = userMaxTestRetries
maxFailures = userMaxTestRetryFailures
}
2015-08-17 11:53:39 +08:00
}
2021-06-01 12:31:09 +08:00
// remove test output from all test types
tasks . withType ( Test ) . all { t - >
cleanTest {
2022-04-21 23:25:20 +08:00
delete t . reports . junitXml . outputLocation
delete t . reports . html . outputLocation
2021-06-01 12:31:09 +08:00
}
}
2014-04-19 04:10:34 +08:00
jar {
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2014-04-19 04:10:34 +08:00
}
2016-01-07 08:19:39 +08:00
task srcJar ( type: Jar ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'sources'
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2016-01-07 08:19:39 +08:00
from sourceSets . main . allSource
2014-04-19 04:10:34 +08:00
}
2014-08-31 00:14:54 +08:00
task javadocJar ( type: Jar , dependsOn: javadoc ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'javadoc'
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2014-08-31 00:14:54 +08:00
from javadoc . destinationDir
}
2014-04-19 04:10:34 +08:00
2014-08-31 00:14:54 +08:00
task docsJar ( dependsOn: javadocJar )
2014-04-19 04:10:34 +08:00
2024-06-01 01:31:08 +08:00
test . dependsOn ( 'javadoc' )
2015-10-29 06:35:13 +08:00
task systemTestLibs ( dependsOn: jar )
2021-03-05 03:22:22 +08:00
if ( ! sourceSets . test . allSource . isEmpty ( ) ) {
2016-01-07 08:19:39 +08:00
task testJar ( type: Jar ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'test'
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2016-01-07 08:19:39 +08:00
from sourceSets . test . output
2024-07-19 18:18:27 +08:00
// The junit-platform.properties file is used for configuring and customizing the behavior of the JUnit platform.
// It should only apply to Kafka's own JUnit tests, and should not exist in the test JAR.
// If we include it in the test JAR, it could lead to conflicts with user configurations.
exclude 'junit-platform.properties'
2016-01-07 08:19:39 +08:00
}
task testSrcJar ( type: Jar , dependsOn: testJar ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'test-sources'
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2016-01-07 08:19:39 +08:00
from sourceSets . test . allSource
}
}
2014-04-19 04:10:34 +08:00
2016-01-07 08:19:39 +08:00
plugins . withType ( ScalaPlugin ) {
2020-04-20 10:24:21 +08:00
scala {
zincVersion = versions . zinc
}
2020-10-27 08:44:25 +08:00
task scaladocJar ( type: Jar , dependsOn: scaladoc ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'scaladoc'
2017-02-01 08:06:10 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
2016-01-07 08:19:39 +08:00
from scaladoc . destinationDir
2014-04-19 04:10:34 +08:00
}
2014-08-31 00:14:54 +08:00
//documentation task should also trigger building scala doc jar
docsJar . dependsOn scaladocJar
2014-04-19 04:10:34 +08:00
}
2014-08-31 00:14:54 +08:00
tasks . withType ( ScalaCompile ) {
2022-02-09 03:03:19 +08:00
MINOR: Reuse gradle daemon for scala compilation by default (#12280)
The time time to compile was reduced from 5.3 seconds to 0.9 seconds by
changing the keep alive mode from `SESSION` to `DAEMON`. We change the
default to the latter and allow the former to be set via a `keepAliveMode`
property.
Also update the Jenkins build to use `keepAliveMode="session"` instead of
`--no-daemon`.
./gradlew compileTestScala -PkeepAliveMode="daemon" --info:
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.004 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 0.925 secs
./gradlew compileTestScala -PkeepAliveMode="session" --info
> Task :streams:streams-scala:compileTestScala
> Watching 928 directories to track changes
> Caching disabled for task ':streams:streams-scala:compileTestScala' because:
> Build cache is disabled
> Task ':streams:streams-scala:compileTestScala' is not up-to-date because:
> Input property 'source' file /home/ijuma/src/kafka/streams/streams-scala/src/test/scala/org/apache/kafka/streams/scala/kstream/JoinedTest.scala has changed.
> Watching 920 directories to track changes
> Watching 919 directories to track changes
> Starting process 'Gradle Worker Daemon 3'. Working directory: /home/ijuma/.gradle/workers Command: /usr/java/jdk-17.0.4.1+1/bin/java -Xss4m -XX:+UseParallelGC --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.file=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.util.stream=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED @/home/ijuma/.gradle/.tmp/gradle-worker-classpath3305983246500958050txt -Xmx2048m -Dfile.encoding=UTF-8 -Duser.country=US -Duser.language=en -Duser.variant worker.org.gradle.process.internal.worker.GradleWorkerMain 'Gradle Worker Daemon 3'
> Successfully started process 'Gradle Worker Daemon 3'
> Started Gradle worker daemon (0.244 secs) with fork options DaemonForkOptions{executable=/usr/java/jdk-17.0.4.1+1/bin/java, minHeapSize=null, maxHeapSize=2048m, jvmArgs=[-Xss4m, -XX:+UseParallelGC, --add-opens=java.base/java.io=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/java.nio.file=ALL-UNNAMED, --add-opens=java.base/java.util=ALL-UNNAMED, --add-opens=java.base/java.util.concurrent=ALL-UNNAMED, --add-opens=java.base/java.util.regex=ALL-UNNAMED, --add-opens=java.base/java.util.stream=ALL-UNNAMED, --add-opens=java.base/java.text=ALL-UNNAMED, --add-opens=java.base/java.time=ALL-UNNAMED, --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED], keepAliveMode=SESSION}.
> Compiling with Zinc Scala compiler.
> Prepared Zinc Scala inputs: 0.187 secs
> compiling 16 Scala sources to /home/ijuma/src/kafka/streams/streams-scala/build/classes/scala/test ...
> done compiling
> Completed Scala compilation: 5.307 secs
See https://github.com/gradle/gradle/issues/20579 for more details.
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>
2022-12-01 21:33:43 +08:00
scalaCompileOptions . keepAliveMode = userKeepAliveMode
2016-03-15 10:14:36 +08:00
scalaCompileOptions . additionalParameters = [
2024-05-18 00:36:38 +08:00
"-deprecation:false" ,
2016-03-15 10:14:36 +08:00
"-unchecked" ,
"-encoding" , "utf8" ,
"-Xlog-reflective-calls" ,
"-feature" ,
"-language:postfixOps" ,
"-language:implicitConversions" ,
2017-07-15 02:44:42 +08:00
"-language:existentials" ,
2022-02-09 03:03:19 +08:00
"-Ybackend-parallelism" , maxScalacThreads . toString ( ) ,
2020-01-07 02:51:01 +08:00
"-Xlint:constant" ,
2017-07-15 02:44:42 +08:00
"-Xlint:delayedinit-select" ,
"-Xlint:doc-detached" ,
"-Xlint:missing-interpolator" ,
"-Xlint:nullary-unit" ,
"-Xlint:option-implicit" ,
"-Xlint:package-object-classes" ,
"-Xlint:poly-implicit-overload" ,
"-Xlint:private-shadow" ,
"-Xlint:stars-align" ,
2020-01-07 02:51:01 +08:00
"-Xlint:type-parameter-shadow" ,
"-Xlint:unused"
2016-03-15 10:14:36 +08:00
]
2021-02-23 13:11:17 +08:00
// See README.md for details on this option and the meaning of each value
if ( userScalaOptimizerMode . equals ( "method" ) )
scalaCompileOptions . additionalParameters + = [ "-opt:l:method" ]
else if ( userScalaOptimizerMode . startsWith ( "inline-" ) ) {
List < String > inlineFrom = [ "-opt-inline-from:org.apache.kafka.**" ]
if ( project . name . equals ( 'core' ) )
inlineFrom . add ( "-opt-inline-from:kafka.**" )
if ( userScalaOptimizerMode . equals ( "inline-scala" ) )
inlineFrom . add ( "-opt-inline-from:scala.**" )
scalaCompileOptions . additionalParameters + = [ "-opt:l:inline" ]
scalaCompileOptions . additionalParameters + = inlineFrom
}
2020-03-15 14:03:13 +08:00
2020-04-23 15:44:03 +08:00
if ( versions . baseScala ! = '2.12' ) {
2020-11-25 02:28:53 +08:00
scalaCompileOptions . additionalParameters + = [ "-opt-warnings" , "-Xlint:strict-unsealed-patmat" ]
2020-04-23 15:44:03 +08:00
// Scala 2.13.2 introduces compiler warnings suppression, which is a pre-requisite for -Xfatal-warnings
scalaCompileOptions . additionalParameters + = [ "-Xfatal-warnings" ]
}
2020-01-07 02:51:01 +08:00
// these options are valid for Scala versions < 2.13 only
// Scala 2.13 removes them, see https://github.com/scala/scala/pull/6502 and https://github.com/scala/scala/pull/5969
if ( versions . baseScala = = '2.12' ) {
2019-06-23 00:26:14 +08:00
scalaCompileOptions . additionalParameters + = [
"-Xlint:by-name-right-associative" ,
2020-06-27 01:19:04 +08:00
"-Xlint:nullary-override" ,
2019-06-23 00:26:14 +08:00
"-Xlint:unsound-match"
]
}
2017-07-15 02:44:42 +08:00
2023-02-24 11:13:43 +08:00
// Scalac 2.12 `-release` requires Java 9 or higher, but Scala 2.13 doesn't have that restriction
2023-03-05 14:25:00 +08:00
if ( versions . baseScala = = "2.13" | | JavaVersion . current ( ) . isJava9Compatible ( ) )
scalaCompileOptions . additionalParameters + = [ "-release" , String . valueOf ( minJavaVersion ) ]
2020-05-06 13:20:29 +08:00
2024-04-17 19:06:07 +08:00
addParametersForTests ( name , options )
2014-08-31 00:14:54 +08:00
configure ( scalaCompileOptions . forkOptions ) {
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
memoryMaximumSize = defaultMaxHeapSize
jvmArgs = defaultJvmArgs
2014-08-31 00:14:54 +08:00
}
}
2016-01-07 08:19:39 +08:00
checkstyle {
2023-09-19 16:51:57 +08:00
configDirectory = rootProject . layout . projectDirectory . dir ( "checkstyle" )
2018-08-18 23:18:28 +08:00
configProperties = checkstyleConfigProperties ( "import-control.xml" )
2020-04-20 10:24:21 +08:00
toolVersion = versions . checkstyle
2016-01-07 08:19:39 +08:00
}
2019-01-18 02:14:41 +08:00
configure ( checkstyleMain ) {
group = 'Verification'
description = 'Run checkstyle on all main Java sources'
}
configure ( checkstyleTest ) {
group = 'Verification'
description = 'Run checkstyle on all test Java sources'
}
2016-01-07 08:19:39 +08:00
test . dependsOn ( 'checkstyleMain' , 'checkstyleTest' )
2016-04-01 01:07:54 +08:00
2023-10-12 20:09:10 +08:00
spotbugs {
toolVersion = versions . spotbugs
excludeFilter = file ( "$rootDir/gradle/spotbugs-exclude.xml" )
ignoreFailures = false
2018-11-28 06:40:17 +08:00
}
2023-10-12 20:09:10 +08:00
test . dependsOn ( 'spotbugsMain' )
2017-03-01 07:04:02 +08:00
2024-05-28 16:42:33 +08:00
tasks . withType ( com . github . spotbugs . snom . SpotBugsTask ) . configureEach {
reports . configure {
2018-11-28 06:40:17 +08:00
// Continue supporting `xmlFindBugsReport` for compatibility
xml . enabled ( project . hasProperty ( 'xmlSpotBugsReport' ) | | project . hasProperty ( 'xmlFindBugsReport' ) )
html . enabled ( ! project . hasProperty ( 'xmlSpotBugsReport' ) & & ! project . hasProperty ( 'xmlFindBugsReport' ) )
2017-03-01 07:04:02 +08:00
}
MINOR: Update to Gradle 6.5 and tweak build jvm config (#8751)
Gradle 6.5 includes a fix for https://github.com/gradle/gradle/pull/12866, which
affects the performance of Scala compilation.
I profiled the scalac build with async profiler and 54% of the time was on GC
even after the Gradle upgrade (it was more than 60% before), so I switched to
the throughput GC (GC latency is less important for batch builds) and it
was reduced to 38%.
I also centralized the jvm configuration in `build.gradle` and simplified it a bit
by removing the minHeapSize configuration from the test tasks.
On my desktop, the time to execute clean builds with no cached Gradle daemon
was reduced from 127 seconds to 97 seconds. With a cached daemon, it was
reduced from 120 seconds to 88 seconds. The performance regression when
we upgraded to Gradle 6.x was 27 seconds with a cached daemon
(https://github.com/apache/kafka/pull/7677#issuecomment-616271179), so it
should be fixed now.
Gradle 6.4 with no cached daemon:
```
BUILD SUCCESSFUL in 2m 7s
115 actionable tasks: 112 executed, 3 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.15s user 0.12s system 0% cpu 2:08.06 total
```
Gradle 6.4 with cached daemon:
```
BUILD SUCCESSFUL in 2m 0s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 0.95s user 0.10s system 0% cpu 2:01.42 total
```
Gradle 6.5 with no cached daemon:
```
BUILD SUCCESSFUL in 1m 46s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.12s system 1% cpu 1:47.71 total
```
Gradle 6.5 with cached daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:38.31 total
```
This PR with no cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 37s
115 actionable tasks: 81 executed, 34 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.27s user 0.10s system 1% cpu 1:38.70 total
```
This PR with cached Gradle daemon:
```
BUILD SUCCESSFUL in 1m 28s
115 actionable tasks: 111 executed, 4 up-to-date
./gradlew clean compileScala compileJava compileTestScala compileTestJava 1.02s user 0.10s system 1% cpu 1:29.35 total
```
Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
2020-06-04 04:18:50 +08:00
maxHeapSize = defaultMaxHeapSize
jvmArgs = defaultJvmArgs
2017-03-01 07:04:02 +08:00
}
2016-04-01 01:07:54 +08:00
// Ignore core since its a scala project
if ( it . path ! = ':core' ) {
2020-06-19 22:32:53 +08:00
if ( userEnableTestCoverage ) {
apply plugin: "jacoco"
jacoco {
toolVersion = versions . jacoco
2016-04-01 01:07:54 +08:00
}
2024-08-17 03:53:13 +08:00
2020-06-19 22:32:53 +08:00
jacocoTestReport {
dependsOn tasks . test
sourceSets sourceSets . main
reports {
2023-07-27 01:52:02 +08:00
html . required = true
xml . required = true
csv . required = false
2020-06-19 22:32:53 +08:00
}
}
2016-04-01 01:07:54 +08:00
}
}
2017-02-11 01:15:12 +08:00
2020-06-19 22:32:53 +08:00
if ( userEnableTestCoverage ) {
2024-03-27 17:51:31 +08:00
def coverageGen = it . path = = ':core' ? 'reportTestScoverage' : 'jacocoTestReport'
2024-03-14 17:36:46 +08:00
tasks . register ( 'reportCoverage' ) . configure { dependsOn ( coverageGen ) }
2020-06-19 22:32:53 +08:00
}
2017-02-11 01:15:12 +08:00
2023-10-03 00:38:29 +08:00
dependencyCheck {
suppressionFile = "$rootDir/gradle/resources/dependencycheck-suppressions.xml"
2023-10-11 22:18:19 +08:00
skipProjects = [ ":jmh-benchmarks" , ":trogdor" ]
2024-04-25 22:10:30 +08:00
skipConfigurations = [ "zinc" ]
2023-10-03 00:38:29 +08:00
}
2024-08-17 03:53:13 +08:00
// the task `removeUnusedImports` is implemented by google-java-format,
// and unfortunately the google-java-format version used by spotless 6.14.0 can't work with JDK 21.
2024-06-09 05:36:17 +08:00
// Hence, we apply spotless tasks only if the env is either JDK11 or JDK17
2024-06-27 20:50:06 +08:00
if ( ( JavaVersion . current ( ) . isJava11 ( ) | | ( JavaVersion . current ( ) = = JavaVersion . VERSION_17 ) ) ) {
2024-06-03 04:02:07 +08:00
apply plugin: 'com.diffplug.spotless'
spotless {
java {
2024-06-20 17:43:25 +08:00
targetExclude ( 'src/generated/**/*.java' , 'src/generated-test/**/*.java' )
2024-06-03 04:02:07 +08:00
importOrder ( 'kafka' , 'org.apache.kafka' , 'com' , 'net' , 'org' , 'java' , 'javax' , '' , '\\#' )
removeUnusedImports ( )
}
}
}
2016-04-01 01:07:54 +08:00
}
2017-04-12 06:37:57 +08:00
gradle . taskGraph . whenReady { taskGraph - >
2018-09-11 04:14:00 +08:00
taskGraph . getAllTasks ( ) . findAll { it . name . contains ( 'spotbugsScoverage' ) | | it . name . contains ( 'spotbugsTest' ) } . each { task - >
2017-04-12 06:37:57 +08:00
task . enabled = false
}
}
2017-02-10 10:37:32 +08:00
def fineTuneEclipseClasspathFile ( eclipse , project ) {
eclipse . classpath . file {
beforeMerged { cp - >
cp . entries . clear ( )
// for the core project add the directories defined under test/scala as separate source directories
if ( project . name . equals ( 'core' ) ) {
cp . entries . add ( new org . gradle . plugins . ide . eclipse . model . SourceFolder ( "src/test/scala/integration" , null ) )
cp . entries . add ( new org . gradle . plugins . ide . eclipse . model . SourceFolder ( "src/test/scala/other" , null ) )
cp . entries . add ( new org . gradle . plugins . ide . eclipse . model . SourceFolder ( "src/test/scala/unit" , null ) )
}
}
whenMerged { cp - >
// for the core project exclude the separate sub-directories defined under test/scala. These are added as source dirs above
if ( project . name . equals ( 'core' ) ) {
cp . entries . findAll { it . kind = = "src" & & it . path . equals ( "src/test/scala" ) } * . excludes = [ "integration/" , "other/" , "unit/" ]
}
2020-01-09 08:25:20 +08:00
/ *
* Set all eclipse build output to go to 'build_eclipse' directory . This is to ensure that gradle and eclipse use different
2023-10-23 18:30:57 +08:00
* build output directories , and also avoid using the eclipse default of 'bin' which clashes with some of our script directories .
2017-02-10 10:37:32 +08:00
* https: //discuss.gradle.org/t/eclipse-generated-files-should-be-put-in-the-same-place-as-the-gradle-generated-files/6986/2
* /
cp . entries . findAll { it . kind = = "output" } * . path = "build_eclipse"
/ *
* Some projects have explicitly added test output dependencies . These are required for the gradle build but not required
* in Eclipse since the dependent projects are added as dependencies . So clean up these from the generated classpath .
* /
cp . entries . removeAll { it . kind = = "lib" & & it . path . matches ( ".*/build/(classes|resources)/test" ) }
}
}
}
2018-08-18 23:18:28 +08:00
def checkstyleConfigProperties ( configFileName ) {
2023-09-19 16:51:57 +08:00
[ importControlFile: "$configFileName" ]
2018-08-18 23:18:28 +08:00
}
2020-06-19 22:32:53 +08:00
if ( userEnableTestCoverage ) {
2024-03-14 17:36:46 +08:00
tasks . register ( 'reportCoverage' ) . configure { dependsOn ( subprojects . reportCoverage ) }
2020-06-19 22:32:53 +08:00
}
2016-04-01 01:07:54 +08:00
2019-04-24 07:16:25 +08:00
def connectPkgs = [
'connect:api' ,
'connect:basic-auth-extension' ,
'connect:file' ,
'connect:json' ,
'connect:runtime' ,
2023-08-17 01:30:24 +08:00
'connect:test-plugins' ,
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
'connect:transforms' ,
'connect:mirror' ,
'connect:mirror-client'
2019-04-24 07:16:25 +08:00
]
2015-11-09 14:11:03 +08:00
tasks . create ( name: "jarConnect" , dependsOn: connectPkgs . collect { it + ":jar" } ) { }
2014-04-19 04:10:34 +08:00
2015-11-09 14:11:03 +08:00
tasks . create ( name: "testConnect" , dependsOn: connectPkgs . collect { it + ":test" } ) { }
2014-02-08 05:48:04 +08:00
2023-11-20 14:09:19 +08:00
project ( ':server' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-server"
}
2023-11-20 14:09:19 +08:00
dependencies {
implementation project ( ':clients' )
2024-08-10 19:31:45 +08:00
implementation project ( ':metadata' )
2023-11-20 14:09:19 +08:00
implementation project ( ':server-common' )
2024-06-14 23:26:00 +08:00
implementation project ( ':storage' )
2024-01-22 22:29:11 +08:00
implementation project ( ':group-coordinator' )
implementation project ( ':transaction-coordinator' )
implementation project ( ':raft' )
2023-12-12 16:17:00 +08:00
implementation libs . metrics
2024-03-30 11:54:22 +08:00
implementation libs . jacksonDatabind
2023-11-20 14:09:19 +08:00
implementation libs . slf4jApi
2024-06-21 16:43:07 +08:00
compileOnly libs . reload4j
2023-11-20 14:09:19 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . mockitoCore
testImplementation libs . junitJupiter
2024-06-21 16:43:07 +08:00
testImplementation libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2023-11-20 14:09:19 +08:00
}
task createVersionFile ( ) {
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
outputs . file receiptFile
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-server.xml" )
}
javadoc {
enabled = false
}
}
2014-02-08 05:48:04 +08:00
project ( ':core' ) {
apply plugin: 'scala'
2021-04-16 02:37:15 +08:00
2020-10-27 08:44:25 +08:00
// scaladoc generation is configured at the sub-module level with an artifacts
// block (cf. see streams-scala). If scaladoc generation is invoked explicitly
// for the `core` module, this ensures the generated jar doesn't include scaladoc
// files since the `core` module doesn't include public APIs.
scaladoc {
enabled = false
}
2020-06-19 22:32:53 +08:00
if ( userEnableTestCoverage )
apply plugin: "org.scoverage"
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka_${versions.baseScala}"
}
2014-02-08 05:48:04 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
// `core` is often used in users' tests, define the following dependencies as `api` for backwards compatibility
// even though the `core` module doesn't expose any public API
api project ( ':clients' )
api libs . scalaLibrary
2021-05-12 00:58:28 +08:00
implementation project ( ':server-common' )
2024-06-07 03:19:20 +08:00
implementation project ( ':group-coordinator:group-coordinator-api' )
2022-11-09 15:49:57 +08:00
implementation project ( ':group-coordinator' )
2024-01-22 22:29:11 +08:00
implementation project ( ':transaction-coordinator' )
2021-03-05 03:22:22 +08:00
implementation project ( ':metadata' )
2023-10-03 17:59:56 +08:00
implementation project ( ':storage:storage-api' )
2023-04-07 00:20:56 +08:00
implementation project ( ':tools:tools-api' )
2021-03-05 03:22:22 +08:00
implementation project ( ':raft' )
2021-04-08 04:52:50 +08:00
implementation project ( ':storage' )
2023-11-20 14:09:19 +08:00
implementation project ( ':server' )
2022-11-09 15:49:57 +08:00
2021-03-05 03:22:22 +08:00
implementation libs . argparse4j
2023-04-20 02:54:07 +08:00
implementation libs . commonsValidator
2021-03-05 03:22:22 +08:00
implementation libs . jacksonDatabind
implementation libs . jacksonModuleScala
implementation libs . jacksonDataformatCsv
implementation libs . jacksonJDK8Datatypes
implementation libs . joptSimple
2021-10-29 02:36:53 +08:00
implementation libs . jose4j
2021-03-05 03:22:22 +08:00
implementation libs . metrics
implementation libs . scalaCollectionCompat
implementation libs . scalaJava8Compat
2017-12-23 02:41:22 +08:00
// only needed transitively, but set it explicitly to ensure it has the same version as scala-library
2021-03-05 03:22:22 +08:00
implementation libs . scalaReflect
implementation libs . scalaLogging
implementation libs . slf4jApi
2024-10-10 07:34:26 +08:00
implementation libs . commonsIo // ZooKeeper dependency. Do not use, this is going away.
2021-03-05 03:22:22 +08:00
implementation ( libs . zookeeper ) {
2021-07-01 02:21:33 +08:00
// Dropwizard Metrics are required by ZooKeeper as of v3.6.0,
// but the library should *not* be used in Kafka code
implementation libs . dropwizardMetrics
2017-12-19 23:15:27 +08:00
exclude module: 'slf4j-log4j12'
exclude module: 'log4j'
2023-08-01 22:10:39 +08:00
// Both Kafka and Zookeeper use slf4j. ZooKeeper moved from log4j to logback in v3.8.0, but Kafka relies on reload4j.
// We are removing Zookeeper's dependency on logback so we have a singular logging backend.
exclude module: 'logback-classic'
exclude module: 'logback-core'
2017-12-19 23:15:27 +08:00
}
2019-07-11 00:45:10 +08:00
// ZooKeeperMain depends on commons-cli but declares the dependency as `provided`
2021-03-05 03:22:22 +08:00
implementation libs . commonsCli
2017-12-19 23:15:27 +08:00
2024-06-21 16:43:07 +08:00
compileOnly libs . reload4j
2014-02-08 05:48:04 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
2022-11-09 15:49:57 +08:00
testImplementation project ( ':group-coordinator' ) . sourceSets . test . output
2021-07-07 07:36:01 +08:00
testImplementation project ( ':metadata' ) . sourceSets . test . output
2021-07-10 03:00:26 +08:00
testImplementation project ( ':raft' ) . sourceSets . test . output
KAFKA-14124: improve quorum controller fault handling (#12447)
Before trying to commit a batch of records to the __cluster_metadata log, the active controller
should try to apply them to its current in-memory state. If this application process fails, the
active controller process should exit, allowing another node to take leadership. This will prevent
most bad metadata records from ending up in the log and help to surface errors during testing.
Similarly, if the active controller attempts to renounce leadership, and the renunciation process
itself fails, the process should exit. This will help avoid bugs where the active controller
continues in an undefined state.
In contrast, standby controllers that experience metadata application errors should continue on, in
order to avoid a scenario where a bad record brings down the whole controller cluster. The
intended effect of these changes is to make it harder to commit a bad record to the metadata log,
but to continue to ride out the bad record as well as possible if such a record does get committed.
This PR introduces the FaultHandler interface to implement these concepts. In junit tests, we use a
FaultHandler implementation which does not exit the process. This allows us to avoid terminating
the gradle test runner, which would be very disruptive. It also allows us to ensure that the test
surfaces these exceptions, which we previously were not doing (the mock fault handler stores the
exception).
In addition to the above, this PR fixes a bug where RaftClient#resign was not being called from the
renounce() function. This bug could have resulted in the raft layer not being informed of an active
controller resigning.
Reviewers: David Arthur <mumrah@gmail.com>
2022-08-05 13:49:45 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2023-10-03 17:59:56 +08:00
testImplementation project ( ':storage:storage-api' ) . sourceSets . test . output
2023-11-20 14:09:19 +08:00
testImplementation project ( ':server' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
testImplementation libs . bcpkix
testImplementation libs . mockitoCore
2025-02-26 09:09:19 +08:00
testImplementation libs . jqwik
2021-03-05 03:22:22 +08:00
testImplementation ( libs . apacheda ) {
2016-03-31 10:30:34 +08:00
exclude group: 'xml-apis' , module: 'xml-apis'
2018-07-06 00:07:53 +08:00
// `mina-core` is a transitive dependency for `apacheds` and `apacheda`.
// It is safer to use from `apacheds` since that is the implementation.
exclude module: 'mina-core'
2016-03-31 10:30:34 +08:00
}
2021-03-05 03:22:22 +08:00
testImplementation libs . apachedsCoreApi
testImplementation libs . apachedsInterceptorKerberos
testImplementation libs . apachedsProtocolShared
testImplementation libs . apachedsProtocolKerberos
testImplementation libs . apachedsProtocolLdap
testImplementation libs . apachedsLdifPartition
testImplementation libs . apachedsMavibotPartition
testImplementation libs . apachedsJdbmPartition
testImplementation libs . junitJupiter
2024-06-21 16:43:07 +08:00
testImplementation libs . slf4jReload4j
2023-07-12 02:25:23 +08:00
testImplementation libs . caffeine
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2016-04-01 01:07:54 +08:00
}
2020-01-09 08:25:20 +08:00
2020-06-19 22:32:53 +08:00
if ( userEnableTestCoverage ) {
scoverage {
scoverageVersion = versions . scoverage
2024-03-14 17:36:46 +08:00
if ( versions . baseScala = = '2.13' ) {
scoverageScalaVersion = '2.13.9' // there's no newer 2.13 artifact, org.scoverage:scalac-scoverage-plugin_2.13.9:2.0.11 is the latest as of now
}
2020-06-19 22:32:53 +08:00
reportDir = file ( "${rootProject.buildDir}/scoverage" )
highlighting = false
minimumRate = 0.0
}
2014-02-08 05:48:04 +08:00
}
configurations {
// manually excludes some unnecessary dependencies
2021-05-15 21:10:04 +08:00
implementation . exclude module: 'javax'
implementation . exclude module: 'jline'
implementation . exclude module: 'jms'
implementation . exclude module: 'jmxri'
implementation . exclude module: 'jmxtools'
implementation . exclude module: 'mail'
2015-10-21 05:13:34 +08:00
// To prevent a UniqueResourceException due the same resource existing in both
// org.apache.directory.api/api-all and org.apache.directory.api/api-ldap-schema-data
2021-05-15 21:10:04 +08:00
testImplementation . exclude module: 'api-ldap-schema-data'
2014-02-08 05:48:04 +08:00
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2014-03-04 01:35:21 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2014-03-04 01:35:21 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2014-03-04 01:35:21 +08:00
exclude ( 'kafka-clients*' )
}
2016-01-12 06:16:58 +08:00
into "$buildDir/dependant-libs-${versions.scala}"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2014-02-08 05:48:04 +08:00
}
2016-03-10 13:13:54 +08:00
task genProtocolErrorDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.common.protocol.Errors'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "protocol_errors.html" ) . newOutputStream ( )
}
2018-04-19 00:18:45 +08:00
task genProtocolTypesDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.common.protocol.types.Type'
2018-04-19 00:18:45 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "protocol_types.html" ) . newOutputStream ( )
}
2016-03-10 13:13:54 +08:00
task genProtocolApiKeyDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.common.protocol.ApiKeys'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "protocol_api_keys.html" ) . newOutputStream ( )
}
task genProtocolMessageDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.common.protocol.Protocol'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "protocol_messages.html" ) . newOutputStream ( )
}
2017-06-09 06:27:30 +08:00
task genAdminClientConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.clients.admin.AdminClientConfig'
2017-06-09 06:27:30 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "admin_client_config.html" ) . newOutputStream ( )
}
2016-03-10 13:13:54 +08:00
task genProducerConfigDocs ( type: JavaExec ) {
2015-11-07 11:23:15 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.clients.producer.ProducerConfig'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "producer_config.html" ) . newOutputStream ( )
2015-11-07 11:23:15 +08:00
}
2016-03-10 13:13:54 +08:00
task genConsumerConfigDocs ( type: JavaExec ) {
2015-11-07 11:23:15 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.clients.consumer.ConsumerConfig'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "consumer_config.html" ) . newOutputStream ( )
2015-11-07 11:23:15 +08:00
}
2016-03-10 13:13:54 +08:00
task genKafkaConfigDocs ( type: JavaExec ) {
2015-11-07 11:23:15 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'kafka.server.KafkaConfig'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "kafka_config.html" ) . newOutputStream ( )
2015-11-07 11:23:15 +08:00
}
KAFKA-3809: Auto-generate documentation for topic-level configuration
ijuma said that it would make sense to split out this work from KAFKA-3234, since KAFKA-3234 had both a mechanical change (generating docs) as well as a change requiring discussion (deprecating/renaming config options).
jjkoshy, I hope you don't mind that I took over this work. It's been 3 months since the last activity on KAFKA-3234, so I thought it would be okay to take over.
This work is essentially is the first 5-6 commits from Joel's https://github.com/apache/kafka/pull/907. However, since I'm not very experienced with git, I didn't do a direct merge/rebase, but instead largely hand-merged it. I did some minor cleanup. All credit goes to Joel, all blame goes to me. :)
For reference, I attached the auto-generated configuration.html file (as a PDF, because github won't let me attache html).
[configuration.pdf](https://github.com/apache/kafka/files/323901/configuration.pdf)
This is my first time writing Scala, so let me know if there are any changes needed.
I don't know who is the right person to review this. ijuma, can you help me redirect this to the appropriate person? Thanks.
Author: James Cheng <jylcheng@yahoo.com>
Reviewers: Ismael Juma <ismael@juma.me.uk>, Joel Koshy <jjkoshy@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>
Closes #1527 from wushujames/generate_topic_docs
2016-08-07 09:14:53 +08:00
task genTopicConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2023-02-08 11:52:42 +08:00
mainClass = 'org.apache.kafka.storage.internals.log.LogConfig'
KAFKA-3809: Auto-generate documentation for topic-level configuration
ijuma said that it would make sense to split out this work from KAFKA-3234, since KAFKA-3234 had both a mechanical change (generating docs) as well as a change requiring discussion (deprecating/renaming config options).
jjkoshy, I hope you don't mind that I took over this work. It's been 3 months since the last activity on KAFKA-3234, so I thought it would be okay to take over.
This work is essentially is the first 5-6 commits from Joel's https://github.com/apache/kafka/pull/907. However, since I'm not very experienced with git, I didn't do a direct merge/rebase, but instead largely hand-merged it. I did some minor cleanup. All credit goes to Joel, all blame goes to me. :)
For reference, I attached the auto-generated configuration.html file (as a PDF, because github won't let me attache html).
[configuration.pdf](https://github.com/apache/kafka/files/323901/configuration.pdf)
This is my first time writing Scala, so let me know if there are any changes needed.
I don't know who is the right person to review this. ijuma, can you help me redirect this to the appropriate person? Thanks.
Author: James Cheng <jylcheng@yahoo.com>
Reviewers: Ismael Juma <ismael@juma.me.uk>, Joel Koshy <jjkoshy@gmail.com>, Ewen Cheslack-Postava <ewen@confluent.io>
Closes #1527 from wushujames/generate_topic_docs
2016-08-07 09:14:53 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "topic_config.html" ) . newOutputStream ( )
}
2017-05-27 06:34:20 +08:00
task genConsumerMetricsDocs ( type: JavaExec ) {
classpath = sourceSets . test . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.clients.consumer.internals.ConsumerMetrics'
2017-05-27 06:34:20 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "consumer_metrics.html" ) . newOutputStream ( )
}
2017-09-06 08:36:53 +08:00
task genProducerMetricsDocs ( type: JavaExec ) {
classpath = sourceSets . test . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.clients.producer.internals.ProducerMetrics'
2017-09-06 08:36:53 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "producer_metrics.html" ) . newOutputStream ( )
}
2018-04-19 00:18:45 +08:00
task siteDocsTar ( dependsOn: [ 'genProtocolErrorDocs' , 'genProtocolTypesDocs' , 'genProtocolApiKeyDocs' , 'genProtocolMessageDocs' ,
2017-06-09 06:27:30 +08:00
'genAdminClientConfigDocs' , 'genProducerConfigDocs' , 'genConsumerConfigDocs' ,
'genKafkaConfigDocs' , 'genTopicConfigDocs' ,
':connect:runtime:genConnectConfigDocs' , ':connect:runtime:genConnectTransformationDocs' ,
2020-06-16 13:07:01 +08:00
':connect:runtime:genConnectPredicateDocs' ,
2018-08-08 05:34:27 +08:00
':connect:runtime:genSinkConnectorConfigDocs' , ':connect:runtime:genSourceConnectorConfigDocs' ,
2017-10-05 02:05:50 +08:00
':streams:genStreamsConfigDocs' , 'genConsumerMetricsDocs' , 'genProducerMetricsDocs' ,
2022-12-01 01:37:37 +08:00
':connect:runtime:genConnectMetricsDocs' , ':connect:runtime:genConnectOpenAPIDocs' ,
':connect:mirror:genMirrorSourceConfigDocs' , ':connect:mirror:genMirrorCheckpointConfigDocs' ,
2023-08-28 16:35:11 +08:00
':connect:mirror:genMirrorHeartbeatConfigDocs' , ':connect:mirror:genMirrorConnectorConfigDocs' ,
':storage:genRemoteLogManagerConfigDoc' , ':storage:genRemoteLogMetadataManagerConfigDoc' ] , type: Tar ) {
2021-03-05 03:22:22 +08:00
archiveClassifier = 'site-docs'
2015-10-03 21:50:45 +08:00
compression = Compression . GZIP
2017-02-01 08:06:10 +08:00
from project . file ( "$rootDir/docs" )
2015-10-03 21:50:45 +08:00
into 'site-docs'
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-10-03 21:50:45 +08:00
}
2015-07-07 07:36:20 +08:00
tasks . create ( name: "releaseTarGz" , dependsOn: configurations . archives . artifacts , type: Tar ) {
2021-03-05 03:22:22 +08:00
into "kafka_${versions.baseScala}-${archiveVersion.get()}"
2015-07-07 07:36:20 +08:00
compression = Compression . GZIP
2017-02-01 08:06:10 +08:00
from ( project . file ( "$rootDir/bin" ) ) { into "bin/" }
from ( project . file ( "$rootDir/config" ) ) { into "config/" }
2021-04-07 04:08:24 +08:00
from ( project . file ( "$rootDir/licenses" ) ) { into "licenses/" }
from "$rootDir/LICENSE-binary" rename { String filename - > filename . replace ( "-binary" , "" ) }
2021-07-30 02:53:29 +08:00
from "$rootDir/NOTICE-binary" rename { String filename - > filename . replace ( "-binary" , "" ) }
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) { into ( "libs/" ) }
2014-02-08 05:48:04 +08:00
from ( configurations . archives . artifacts . files ) { into ( "libs/" ) }
2015-10-03 21:50:45 +08:00
from ( project . siteDocsTar ) { into ( "site-docs/" ) }
2015-10-31 06:30:34 +08:00
from ( project ( ':tools' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':tools' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2021-04-16 02:37:15 +08:00
from ( project ( ':trogdor' ) . jar ) { into ( "libs/" ) }
from ( project ( ':trogdor' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2021-04-13 13:26:54 +08:00
from ( project ( ':shell' ) . jar ) { into ( "libs/" ) }
from ( project ( ':shell' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2015-11-13 03:11:56 +08:00
from ( project ( ':connect:api' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:api' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2015-11-13 03:11:56 +08:00
from ( project ( ':connect:runtime' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:runtime' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2017-01-13 08:14:53 +08:00
from ( project ( ':connect:transforms' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:transforms' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2015-11-13 03:11:56 +08:00
from ( project ( ':connect:json' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:json' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2015-11-13 03:11:56 +08:00
from ( project ( ':connect:file' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:file' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2018-06-07 12:09:16 +08:00
from ( project ( ':connect:basic-auth-extension' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:basic-auth-extension' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
from ( project ( ':connect:mirror' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:mirror' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
from ( project ( ':connect:mirror-client' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':connect:mirror-client' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2016-03-01 04:50:24 +08:00
from ( project ( ':streams' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':streams' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2018-04-24 04:33:35 +08:00
from ( project ( ':streams:streams-scala' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':streams:streams-scala' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2018-01-30 09:21:48 +08:00
from ( project ( ':streams:test-utils' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':streams:test-utils' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2016-03-02 10:53:58 +08:00
from ( project ( ':streams:examples' ) . jar ) { into ( "libs/" ) }
2021-03-05 03:22:22 +08:00
from ( project ( ':streams:examples' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2023-04-07 00:20:56 +08:00
from ( project ( ':tools:tools-api' ) . jar ) { into ( "libs/" ) }
from ( project ( ':tools:tools-api' ) . configurations . runtimeClasspath ) { into ( "libs/" ) }
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2014-02-08 05:48:04 +08:00
}
2014-04-19 04:10:34 +08:00
2014-02-13 00:22:51 +08:00
jar {
2016-05-10 06:36:22 +08:00
dependsOn ( 'copyDependantLibs' )
2014-02-13 00:22:51 +08:00
}
2014-02-08 05:48:04 +08:00
2014-11-20 09:57:41 +08:00
jar . manifest {
attributes (
'Version' : "${version}"
)
}
2025-02-26 09:09:19 +08:00
test {
useJUnitPlatform {
includeEngines 'jqwik' , 'junit-jupiter'
}
}
2015-11-04 13:25:15 +08:00
tasks . create ( name: "copyDependantTestLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2015-11-04 13:25:15 +08:00
include ( '*.jar' )
}
into "$buildDir/dependant-testlibs"
2018-08-20 18:46:57 +08:00
//By default gradle does not handle test dependencies between the sub-projects
//This line is to include clients project test jar to dependant-testlibs
from ( project ( ':clients' ) . testJar ) { "$buildDir/dependant-testlibs" }
2024-08-17 03:53:13 +08:00
// log4j-appender is not in core dependencies,
2024-07-12 22:35:55 +08:00
// so we add it to dependant-testlibs to avoid ClassNotFoundException in running kafka_log4j_appender.py
from ( project ( ':log4j-appender' ) . jar ) { "$buildDir/dependant-testlibs" }
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-11-04 13:25:15 +08:00
}
2015-12-22 14:48:03 +08:00
2016-05-10 06:36:22 +08:00
systemTestLibs . dependsOn ( 'jar' , 'testJar' , 'copyDependantTestLibs' )
2015-12-22 14:48:03 +08:00
checkstyle {
2018-08-18 23:18:28 +08:00
configProperties = checkstyleConfigProperties ( "import-control-core.xml" )
2015-12-22 14:48:03 +08:00
}
2020-11-18 14:49:04 +08:00
sourceSets {
2021-04-07 03:10:55 +08:00
// Set java/scala source folders in the `scala` block to enable joint compilation
2020-11-18 14:49:04 +08:00
main {
java {
2021-04-07 03:10:55 +08:00
srcDirs = [ ]
}
scala {
srcDirs = [ "src/generated/java" , "src/main/java" , "src/main/scala" ]
2020-11-18 14:49:04 +08:00
}
}
test {
java {
2021-02-10 00:49:33 +08:00
srcDirs = [ ]
}
scala {
srcDirs = [ "src/test/java" , "src/test/scala" ]
2020-11-18 14:49:04 +08:00
}
}
}
2014-02-08 05:48:04 +08:00
}
2021-01-15 01:58:52 +08:00
project ( ':metadata' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-metadata"
}
2021-01-15 01:58:52 +08:00
2022-04-21 23:25:20 +08:00
configurations {
generator
}
2021-01-15 01:58:52 +08:00
dependencies {
2021-05-12 00:58:28 +08:00
implementation project ( ':server-common' )
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
2021-05-21 06:39:46 +08:00
implementation project ( ':raft' )
2021-03-05 03:22:22 +08:00
implementation libs . jacksonDatabind
implementation libs . jacksonJDK8Datatypes
implementation libs . metrics
2024-06-21 16:43:07 +08:00
compileOnly libs . reload4j
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2022-10-05 07:31:43 +08:00
testImplementation libs . jqwik
2021-03-05 03:22:22 +08:00
testImplementation libs . hamcrest
2022-04-14 01:33:15 +08:00
testImplementation libs . mockitoCore
2024-06-21 16:43:07 +08:00
testImplementation libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
2021-05-21 06:39:46 +08:00
testImplementation project ( ':raft' ) . sourceSets . test . output
KAFKA-14124: improve quorum controller fault handling (#12447)
Before trying to commit a batch of records to the __cluster_metadata log, the active controller
should try to apply them to its current in-memory state. If this application process fails, the
active controller process should exit, allowing another node to take leadership. This will prevent
most bad metadata records from ending up in the log and help to surface errors during testing.
Similarly, if the active controller attempts to renounce leadership, and the renunciation process
itself fails, the process should exit. This will help avoid bugs where the active controller
continues in an undefined state.
In contrast, standby controllers that experience metadata application errors should continue on, in
order to avoid a scenario where a bad record brings down the whole controller cluster. The
intended effect of these changes is to make it harder to commit a bad record to the metadata log,
but to continue to ride out the bad record as well as possible if such a record does get committed.
This PR introduces the FaultHandler interface to implement these concepts. In junit tests, we use a
FaultHandler implementation which does not exit the process. This allows us to avoid terminating
the gradle test runner, which would be very disruptive. It also allows us to ensure that the test
surfaces these exceptions, which we previously were not doing (the mock fault handler stores the
exception).
In addition to the above, this PR fixes a bug where RaftClient#resign was not being called from the
renounce() function. This bug could have resulted in the raft layer not being informed of an active
controller resigning.
Reviewers: David Arthur <mumrah@gmail.com>
2022-08-05 13:49:45 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2022-04-21 23:25:20 +08:00
generator project ( ':generator' )
2021-01-15 01:58:52 +08:00
}
task processMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2021-01-15 01:58:52 +08:00
args = [ "-p" , "org.apache.kafka.common.metadata" ,
"-o" , "src/generated/java/org/apache/kafka/common/metadata" ,
"-i" , "src/main/resources/common/metadata" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator" ,
"-t" , "MetadataRecordTypeGenerator" , "MetadataJsonConvertersGenerator"
]
inputs . dir ( "src/main/resources/common/metadata" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
2021-01-15 01:58:52 +08:00
outputs . dir ( "src/generated/java/org/apache/kafka/common/metadata" )
}
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
2021-01-15 01:58:52 +08:00
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2024-03-14 17:36:46 +08:00
srcDirs = [ "src/test/java" ]
2021-01-15 01:58:52 +08:00
}
}
}
javadoc {
enabled = false
}
2023-04-18 05:52:28 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-metadata.xml" )
}
2021-01-15 01:58:52 +08:00
}
2024-06-07 03:19:20 +08:00
project ( ':group-coordinator:group-coordinator-api' ) {
base {
archivesName = "kafka-group-coordinator-api"
}
dependencies {
implementation project ( ':clients' )
}
task createVersionFile ( ) {
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
outputs . file receiptFile
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
sourceSets {
main {
java {
srcDirs = [ "src/main/java" ]
}
}
test {
java {
srcDirs = [ "src/test/java" ]
}
}
}
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
javadoc {
include "**/org/apache/kafka/coordinator/group/api/**"
}
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-group-coordinator.xml" )
}
}
2022-11-09 15:49:57 +08:00
project ( ':group-coordinator' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-group-coordinator"
}
2022-11-09 15:49:57 +08:00
2023-02-07 16:06:56 +08:00
configurations {
generator
}
2022-11-09 15:49:57 +08:00
dependencies {
implementation project ( ':server-common' )
implementation project ( ':clients' )
2023-03-08 15:52:01 +08:00
implementation project ( ':metadata' )
2024-06-07 03:19:20 +08:00
implementation project ( ':group-coordinator:group-coordinator-api' )
2024-01-11 20:58:57 +08:00
implementation project ( ':storage' )
2024-05-07 08:49:31 +08:00
implementation libs . jacksonDatabind
implementation libs . jacksonJDK8Datatypes
2022-11-09 15:49:57 +08:00
implementation libs . slf4jApi
KAFKA-14519; [1/N] Implement coordinator runtime metrics (#14417)
Implements the following metrics:
kafka.server:type=group-coordinator-metrics,name=num-partitions,state=loading
kafka.server:type=group-coordinator-metrics,name=num-partitions,state=active
kafka.server:type=group-coordinator-metrics,name=num-partitions,state=failed
kafka.server:type=group-coordinator-metrics,name=event-queue-size
kafka.server:type=group-coordinator-metrics,name=partition-load-time-max
kafka.server:type=group-coordinator-metrics,name=partition-load-time-avg
kafka.server:type=group-coordinator-metrics,name=thread-idle-ratio-min
kafka.server:type=group-coordinator-metrics,name=thread-idle-ratio-avg
The PR makes these metrics generic so that in the future the transaction coordinator runtime can implement the same metrics in a similar fashion.
Also, CoordinatorLoaderImpl#load will now return LoadSummary which encapsulates the start time, end time, number of records/bytes.
Co-authored-by: David Jacot <djacot@confluent.io>
Reviewers: Ritika Reddy <rreddy@confluent.io>, Calvin Liu <caliu@confluent.io>, David Jacot <djacot@confluent.io>, Justine Olshan <jolshan@confluent.io>
2023-10-18 07:06:23 +08:00
implementation libs . metrics
2022-11-09 15:49:57 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation project ( ':server-common' ) . sourceSets . test . output
testImplementation libs . junitJupiter
testImplementation libs . mockitoCore
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2023-02-07 16:06:56 +08:00
generator project ( ':generator' )
2022-11-09 15:49:57 +08:00
}
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2024-07-25 18:43:46 +08:00
srcDirs = [ "src/test/java" ]
2022-11-09 15:49:57 +08:00
}
}
}
javadoc {
enabled = false
}
2023-02-07 16:06:56 +08:00
2024-05-14 15:05:32 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-group-coordinator.xml" )
}
2023-02-07 16:06:56 +08:00
task processMessages ( type: JavaExec ) {
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
args = [ "-p" , "org.apache.kafka.coordinator.group.generated" ,
"-o" , "src/generated/java/org/apache/kafka/coordinator/group/generated" ,
"-i" , "src/main/resources/common/message" ,
2024-05-07 08:49:31 +08:00
"-m" , "MessageDataGenerator" , "JsonConverterGenerator"
2023-02-07 16:06:56 +08:00
]
inputs . dir ( "src/main/resources/common/message" )
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
outputs . dir ( "src/generated/java/org/apache/kafka/coordinator/group/generated" )
}
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
2022-11-09 15:49:57 +08:00
}
2024-01-22 22:29:11 +08:00
project ( ':transaction-coordinator' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-transaction-coordinator"
}
2024-01-22 22:29:11 +08:00
2024-07-25 00:42:25 +08:00
configurations {
generator
}
2024-06-14 23:26:00 +08:00
dependencies {
2024-07-25 00:42:25 +08:00
implementation libs . jacksonDatabind
2024-06-14 23:26:00 +08:00
implementation project ( ':clients' )
2024-07-25 00:42:25 +08:00
generator project ( ':generator' )
2024-06-14 23:26:00 +08:00
}
2024-08-17 03:53:13 +08:00
2024-01-22 22:29:11 +08:00
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2024-07-25 18:43:46 +08:00
srcDirs = [ "src/test/java" ]
2024-01-22 22:29:11 +08:00
}
}
}
2024-06-14 23:26:00 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-transaction-coordinator.xml" )
}
2024-07-25 00:42:25 +08:00
task processMessages ( type: JavaExec ) {
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
args = [ "-p" , "org.apache.kafka.coordinator.transaction.generated" ,
"-o" , "src/generated/java/org/apache/kafka/coordinator/transaction/generated" ,
"-i" , "src/main/resources/common/message" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator"
]
inputs . dir ( "src/main/resources/common/message" )
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
outputs . dir ( "src/generated/java/org/apache/kafka/coordinator/transaction/generated" )
}
compileJava . dependsOn 'processMessages'
srcJar . dependsOn 'processMessages'
2024-01-22 22:29:11 +08:00
javadoc {
enabled = false
}
}
2014-02-08 05:48:04 +08:00
project ( ':examples' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-examples"
}
2014-02-08 05:48:04 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
2014-02-08 05:48:04 +08:00
}
2014-02-13 00:22:51 +08:00
2016-05-19 07:44:31 +08:00
javadoc {
enabled = false
}
2015-12-22 14:48:03 +08:00
checkstyle {
2018-08-18 23:18:28 +08:00
configProperties = checkstyleConfigProperties ( "import-control-core.xml" )
2015-12-22 14:48:03 +08:00
}
2014-02-08 05:48:04 +08:00
}
2019-01-22 13:06:37 +08:00
project ( ':generator' ) {
dependencies {
2021-03-05 03:22:22 +08:00
implementation libs . argparse4j
implementation libs . jacksonDatabind
implementation libs . jacksonJDK8Datatypes
implementation libs . jacksonJaxrsJsonProvider
testImplementation libs . junitJupiter
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2019-01-22 13:06:37 +08:00
}
javadoc {
enabled = false
}
}
2014-02-08 05:48:04 +08:00
project ( ':clients' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-clients"
}
2014-02-08 05:48:04 +08:00
2022-04-21 23:25:20 +08:00
configurations {
generator
2024-04-04 17:56:08 +08:00
shadowed
2022-04-21 23:25:20 +08:00
}
2014-02-08 05:48:04 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation libs . zstd
implementation libs . lz4
implementation libs . snappy
implementation libs . slf4jApi
2023-11-02 12:53:24 +08:00
implementation libs . opentelemetryProto
2024-10-10 07:34:26 +08:00
implementation libs . protobuf
2023-11-02 12:53:24 +08:00
// libraries which should be added as runtime dependencies in generated pom.xml should be defined here:
2024-04-04 17:56:08 +08:00
shadowed libs . zstd
shadowed libs . lz4
shadowed libs . snappy
shadowed libs . slf4jApi
2019-06-06 05:10:00 +08:00
2018-06-12 16:58:58 +08:00
compileOnly libs . jacksonDatabind // for SASL/OAUTHBEARER bearer token parsing
2018-11-28 04:49:53 +08:00
compileOnly libs . jacksonJDK8Datatypes
2021-10-29 02:36:53 +08:00
compileOnly libs . jose4j // for SASL/OAUTHBEARER JWT validation; only used by broker
2018-06-12 16:58:58 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . bcpkix
2022-10-22 00:18:00 +08:00
testImplementation libs . jacksonJaxrsJsonProvider
testImplementation libs . jose4j
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2024-06-21 16:43:07 +08:00
testImplementation libs . reload4j
2025-02-26 09:09:19 +08:00
testImplementation libs . jqwik
2023-09-24 21:01:28 +08:00
testImplementation libs . mockitoCore
2023-11-23 17:53:17 +08:00
testImplementation libs . mockitoJunitJupiter // supports MockitoExtension
2014-03-27 12:48:55 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
testRuntimeOnly libs . jacksonDatabind
testRuntimeOnly libs . jacksonJDK8Datatypes
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2022-04-21 23:25:20 +08:00
generator project ( ':generator' )
2014-02-08 05:48:04 +08:00
}
2022-02-09 03:03:19 +08:00
task createVersionFile ( ) {
2022-04-21 23:25:20 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
2015-08-21 04:24:14 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2015-08-21 04:24:14 +08:00
doLast {
def data = [
2017-08-04 06:24:05 +08:00
commitId: commitId ,
2015-08-21 04:24:14 +08:00
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
2023-11-02 12:53:24 +08:00
shadowJar {
2015-08-21 04:24:14 +08:00
dependsOn createVersionFile
2023-11-02 12:53:24 +08:00
// archiveClassifier defines the classifier for the shadow jar, the default is 'all'.
// We don't want to use the default classifier because it will cause the shadow jar to
// overwrite the original jar. We also don't want to use the 'shadow' classifier because
// it will cause the shadow jar to be named kafka-clients-shadow.jar. We want to use the
// same name as the original jar, kafka-clients.jar.
archiveClassifier = null
// KIP-714: move shaded dependencies to a shaded location
relocate ( 'io.opentelemetry.proto' , 'org.apache.kafka.shaded.io.opentelemetry.proto' )
relocate ( 'com.google.protobuf' , 'org.apache.kafka.shaded.com.google.protobuf' )
// dependencies excluded from the final jar, since they are declared as runtime dependencies
dependencies {
2024-04-04 17:56:08 +08:00
project . configurations . shadowed . allDependencies . each {
2024-04-29 16:58:12 +08:00
exclude ( dependency ( it . group + ':' + it . name ) )
2024-04-04 17:56:08 +08:00
}
2023-11-02 12:53:24 +08:00
// exclude proto files from the jar
exclude "**/opentelemetry/proto/**/*.proto"
exclude "**/google/protobuf/*.proto"
}
2015-08-21 04:24:14 +08:00
from ( "$buildDir" ) {
2023-11-02 12:53:24 +08:00
include "kafka/$buildVersionFileName"
2015-08-21 04:24:14 +08:00
}
2023-11-02 12:53:24 +08:00
from "$rootDir/LICENSE"
from "$rootDir/NOTICE"
}
jar {
enabled false
dependsOn 'shadowJar'
2015-08-21 04:24:14 +08:00
}
clean . doFirst {
delete "$buildDir/kafka/"
}
2019-01-22 13:06:37 +08:00
task processMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2020-08-27 06:10:09 +08:00
args = [ "-p" , "org.apache.kafka.common.message" ,
"-o" , "src/generated/java/org/apache/kafka/common/message" ,
"-i" , "src/main/resources/common/message" ,
"-t" , "ApiMessageTypeGenerator" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator"
]
2019-01-22 13:06:37 +08:00
inputs . dir ( "src/main/resources/common/message" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
2019-01-22 13:06:37 +08:00
outputs . dir ( "src/generated/java/org/apache/kafka/common/message" )
2019-01-12 08:40:21 +08:00
}
2019-09-14 02:36:58 +08:00
task processTestMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2020-08-27 06:10:09 +08:00
args = [ "-p" , "org.apache.kafka.common.message" ,
"-o" , "src/generated-test/java/org/apache/kafka/common/message" ,
"-i" , "src/test/resources/common/message" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator"
]
2019-09-14 02:36:58 +08:00
inputs . dir ( "src/test/resources/common/message" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "testMessages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
2019-09-14 02:36:58 +08:00
outputs . dir ( "src/generated-test/java/org/apache/kafka/common/message" )
}
2019-01-12 08:40:21 +08:00
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2022-08-10 21:54:31 +08:00
srcDirs = [ "src/generated-test/java" , "src/test/java" ]
2019-01-12 08:40:21 +08:00
}
}
}
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
2019-01-12 08:40:21 +08:00
2019-09-14 02:36:58 +08:00
compileTestJava . dependsOn 'processTestMessages'
2014-11-18 10:53:16 +08:00
javadoc {
2017-06-09 06:27:30 +08:00
include "**/org/apache/kafka/clients/admin/*"
2015-01-12 03:29:48 +08:00
include "**/org/apache/kafka/clients/consumer/*"
2014-11-18 10:53:16 +08:00
include "**/org/apache/kafka/clients/producer/*"
2015-01-13 14:01:43 +08:00
include "**/org/apache/kafka/common/*"
2017-06-09 06:27:30 +08:00
include "**/org/apache/kafka/common/acl/*"
2017-06-14 23:57:49 +08:00
include "**/org/apache/kafka/common/annotation/*"
2014-11-18 10:53:16 +08:00
include "**/org/apache/kafka/common/errors/*"
2017-04-29 10:17:57 +08:00
include "**/org/apache/kafka/common/header/*"
2020-07-23 12:57:23 +08:00
include "**/org/apache/kafka/common/metrics/*"
include "**/org/apache/kafka/common/metrics/stats/*"
2021-01-09 03:57:22 +08:00
include "**/org/apache/kafka/common/quota/*"
2017-06-09 06:27:30 +08:00
include "**/org/apache/kafka/common/resource/*"
2015-01-07 03:07:46 +08:00
include "**/org/apache/kafka/common/serialization/*"
2016-03-18 04:26:02 +08:00
include "**/org/apache/kafka/common/config/*"
2018-06-13 03:52:51 +08:00
include "**/org/apache/kafka/common/config/provider/*"
2017-10-05 00:20:21 +08:00
include "**/org/apache/kafka/common/security/auth/*"
2018-06-11 18:29:02 +08:00
include "**/org/apache/kafka/common/security/plain/*"
include "**/org/apache/kafka/common/security/scram/*"
2018-04-12 01:48:04 +08:00
include "**/org/apache/kafka/common/security/token/delegation/*"
2018-05-26 15:18:41 +08:00
include "**/org/apache/kafka/common/security/oauthbearer/*"
2022-03-04 02:13:01 +08:00
include "**/org/apache/kafka/common/security/oauthbearer/secured/*"
2019-09-02 21:43:17 +08:00
include "**/org/apache/kafka/server/authorizer/*"
2018-06-11 18:29:02 +08:00
include "**/org/apache/kafka/server/policy/*"
2018-07-04 02:42:44 +08:00
include "**/org/apache/kafka/server/quota/*"
2023-10-27 04:06:38 +08:00
include "**/org/apache/kafka/server/telemetry/*"
2014-11-18 10:53:16 +08:00
}
2015-07-07 07:36:20 +08:00
}
2020-09-23 02:32:44 +08:00
project ( ':raft' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-raft"
}
2020-09-23 02:32:44 +08:00
2022-04-21 23:25:20 +08:00
configurations {
generator
}
2020-09-23 02:32:44 +08:00
dependencies {
2021-05-12 00:58:28 +08:00
implementation project ( ':server-common' )
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
implementation libs . slf4jApi
implementation libs . jacksonDatabind
2020-09-23 02:32:44 +08:00
2021-05-12 00:58:28 +08:00
testImplementation project ( ':server-common' )
2024-01-06 01:27:36 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' )
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . junitJupiter
testImplementation libs . mockitoCore
2021-03-18 10:20:07 +08:00
testImplementation libs . jqwik
2024-08-17 03:53:13 +08:00
testImplementation libs . hamcrest
2020-09-23 02:32:44 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2022-04-21 23:25:20 +08:00
generator project ( ':generator' )
2020-09-23 02:32:44 +08:00
}
2022-02-09 03:03:19 +08:00
task createVersionFile ( ) {
2022-04-21 23:25:20 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
2020-09-23 02:32:44 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2020-09-23 02:32:44 +08:00
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
task processMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2020-09-23 02:32:44 +08:00
args = [ "-p" , "org.apache.kafka.raft.generated" ,
"-o" , "src/generated/java/org/apache/kafka/raft/generated" ,
"-i" , "src/main/resources/common/message" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator" ]
inputs . dir ( "src/main/resources/common/message" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
2020-09-23 02:32:44 +08:00
outputs . dir ( "src/generated/java/org/apache/kafka/raft/generated" )
}
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2024-03-14 17:36:46 +08:00
srcDirs = [ "src/test/java" ]
2020-09-23 02:32:44 +08:00
}
}
}
2021-04-16 02:37:15 +08:00
2020-09-23 02:32:44 +08:00
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
2020-09-23 02:32:44 +08:00
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
2021-03-18 10:20:07 +08:00
test {
useJUnitPlatform {
includeEngines 'jqwik' , 'junit-jupiter'
}
}
2020-09-23 02:32:44 +08:00
clean . doFirst {
delete "$buildDir/kafka/"
}
javadoc {
2020-10-07 04:02:52 +08:00
enabled = false
2020-09-23 02:32:44 +08:00
}
}
2021-05-12 00:58:28 +08:00
project ( ':server-common' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-server-common"
}
2021-05-12 00:58:28 +08:00
dependencies {
api project ( ':clients' )
implementation libs . slf4jApi
2022-03-31 04:59:22 +08:00
implementation libs . metrics
2023-01-27 03:06:09 +08:00
implementation libs . joptSimple
2023-07-18 17:02:40 +08:00
implementation libs . jacksonDatabind
2023-04-18 05:52:28 +08:00
implementation libs . pcollections
2021-05-12 00:58:28 +08:00
testImplementation project ( ':clients' )
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . junitJupiter
testImplementation libs . mockitoCore
2022-11-04 15:52:32 +08:00
testImplementation libs . hamcrest
2021-05-12 00:58:28 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-05-12 00:58:28 +08:00
}
2022-02-09 03:03:19 +08:00
task createVersionFile ( ) {
2022-04-21 23:25:20 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
2021-05-12 00:58:28 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2021-05-12 00:58:28 +08:00
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
2023-04-18 05:52:28 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-server-common.xml" )
}
2023-11-20 14:09:19 +08:00
javadoc {
enabled = false
}
2021-05-12 00:58:28 +08:00
}
2023-10-03 17:59:56 +08:00
project ( ':storage:storage-api' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-storage-api"
}
2021-04-08 04:52:50 +08:00
dependencies {
implementation project ( ':clients' )
2023-08-05 13:00:16 +08:00
implementation project ( ':server-common' )
implementation libs . metrics
2021-04-08 04:52:50 +08:00
implementation libs . slf4jApi
testImplementation project ( ':clients' )
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . junitJupiter
testImplementation libs . mockitoCore
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-04-08 04:52:50 +08:00
}
2022-02-09 03:03:19 +08:00
task createVersionFile ( ) {
2022-04-21 23:25:20 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
2021-04-08 04:52:50 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2021-04-08 04:52:50 +08:00
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
sourceSets {
main {
java {
srcDirs = [ "src/main/java" ]
}
}
test {
java {
srcDirs = [ "src/test/java" ]
}
}
}
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
javadoc {
include "**/org/apache/kafka/server/log/remote/storage/*"
}
2023-08-20 19:45:52 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-storage.xml" )
}
2021-04-08 04:52:50 +08:00
}
project ( ':storage' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-storage"
}
2021-04-08 04:52:50 +08:00
2022-04-21 23:25:20 +08:00
configurations {
generator
}
2021-04-08 04:52:50 +08:00
dependencies {
2023-10-03 17:59:56 +08:00
implementation project ( ':storage:storage-api' )
2021-05-12 00:58:28 +08:00
implementation project ( ':server-common' )
2021-04-08 04:52:50 +08:00
implementation project ( ':clients' )
2024-07-23 20:08:08 +08:00
implementation project ( ':transaction-coordinator' )
2024-07-15 23:39:38 +08:00
implementation ( libs . caffeine ) {
exclude group: 'org.checkerframework' , module: 'checker-qual'
}
2021-04-08 04:52:50 +08:00
implementation libs . slf4jApi
implementation libs . jacksonDatabind
2023-07-18 22:46:19 +08:00
implementation libs . metrics
2021-04-08 04:52:50 +08:00
testImplementation project ( ':clients' )
testImplementation project ( ':clients' ) . sourceSets . test . output
2021-07-20 00:05:46 +08:00
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
2024-04-16 15:28:35 +08:00
testImplementation project ( ':server' )
2022-08-06 10:17:50 +08:00
testImplementation project ( ':server-common' )
testImplementation project ( ':server-common' ) . sourceSets . test . output
2023-08-20 19:45:52 +08:00
testImplementation libs . hamcrest
2021-04-08 04:52:50 +08:00
testImplementation libs . junitJupiter
testImplementation libs . mockitoCore
2021-07-20 00:05:46 +08:00
testImplementation libs . bcpkix
2021-04-08 04:52:50 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2022-04-21 23:25:20 +08:00
generator project ( ':generator' )
2021-04-08 04:52:50 +08:00
}
2022-02-09 03:03:19 +08:00
task createVersionFile ( ) {
2022-04-21 23:25:20 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
2021-04-08 04:52:50 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2021-04-08 04:52:50 +08:00
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
2021-05-05 22:48:52 +08:00
task processMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2023-11-02 21:46:05 +08:00
args = [ "-p" , "org.apache.kafka.server.log.remote.metadata.storage.generated" ,
2021-05-05 22:48:52 +08:00
"-o" , "src/generated/java/org/apache/kafka/server/log/remote/metadata/storage/generated" ,
"-i" , "src/main/resources/message" ,
"-m" , "MessageDataGenerator" , "JsonConverterGenerator" ,
"-t" , "MetadataRecordTypeGenerator" , "MetadataJsonConvertersGenerator" ]
inputs . dir ( "src/main/resources/message" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
2021-05-05 22:48:52 +08:00
outputs . dir ( "src/generated/java/org/apache/kafka/server/log/remote/metadata/storage/generated" )
}
2023-08-28 16:35:11 +08:00
task genRemoteLogManagerConfigDoc ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.server.log.remote.storage.RemoteLogManagerConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "remote_log_manager_config.html" ) . newOutputStream ( )
}
task genRemoteLogMetadataManagerConfigDoc ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.server.log.remote.metadata.storage.TopicBasedRemoteLogMetadataManagerConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "remote_log_metadata_manager_config.html" ) . newOutputStream ( )
}
2021-04-08 04:52:50 +08:00
sourceSets {
main {
java {
2021-05-05 22:48:52 +08:00
srcDirs = [ "src/generated/java" , "src/main/java" ]
2021-04-08 04:52:50 +08:00
}
}
test {
java {
2024-03-14 17:36:46 +08:00
srcDirs = [ "src/test/java" ]
2021-04-08 04:52:50 +08:00
}
}
}
2021-05-05 22:48:52 +08:00
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
2021-05-05 22:48:52 +08:00
2021-04-08 04:52:50 +08:00
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
javadoc {
enabled = false
}
2023-08-20 19:45:52 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-storage.xml" )
}
2021-04-08 04:52:50 +08:00
}
2023-04-07 00:20:56 +08:00
project ( ':tools:tools-api' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-tools-api"
}
2023-04-07 00:20:56 +08:00
dependencies {
implementation project ( ':clients' )
testImplementation libs . junitJupiter
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2023-04-07 00:20:56 +08:00
}
task createVersionFile ( ) {
def receiptFile = file ( "$buildDir/kafka/$buildVersionFileName" )
inputs . property "commitId" , commitId
inputs . property "version" , version
outputs . file receiptFile
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
sourceSets {
main {
java {
srcDirs = [ "src/main/java" ]
}
}
test {
java {
srcDirs = [ "src/test/java" ]
}
}
}
jar {
dependsOn createVersionFile
from ( "$buildDir" ) {
include "kafka/$buildVersionFileName"
}
}
clean . doFirst {
delete "$buildDir/kafka/"
}
javadoc {
include "**/org/apache/kafka/tools/api/*"
}
}
2015-07-29 08:22:14 +08:00
project ( ':tools' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-tools"
}
2016-03-26 07:04:58 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
KAFKA-16523; kafka-metadata-quorum: support add-controller and remove-controller (#16774)
This PR adds support for add-controller and remove-controller in the kafka-metadata-quorum.sh
command-line tool. It also fixes some minor server-side bugs that blocked the tool from working.
In kafka-metadata-quorum.sh, the implementation of remove-controller is fairly straightforward. It
just takes some command-line flags and uses them to invoke AdminClient. The add-controller
implementation is a bit more complex because we have to look at the new controller's configuration
file. The parsing logic for the advertised.listeners and listeners server configurations that we
need was previously implemented in the :core module. However, the gradle module where
kafka-metadata-quorum.sh lives, :tools, cannot depend on :core. Therefore, I moved listener parsing
into SocketServerConfigs.listenerListToEndPoints. This will be a small step forward in our efforts
to move Kafka configuration out of :core.
I also made some minor changes in kafka-metadata-quorum.sh and Kafka-storage-tool.sh to handle
--help without displaying a backtrace on the screen, and give slightly better error messages on
stderr. Also, in DynamicVoter.toString, we now enclose the host in brackets if it contains a colon
(as IPV6 addresses can).
This PR fixes our handling of clusterId in addRaftVoter and removeRaftVoter, in two ways. Firstly,
it marks clusterId as nullable in the AddRaftVoterRequest.json and RemoveRaftVoterRequest.json
schemas, as it was always intended to be. Secondly, it allows AdminClient to optionally send
clusterId, by using AddRaftVoterOptions and RemoveRaftVoterOptions. We now also remember to
properly set timeoutMs in AddRaftVoterRequest. This PR adds unit tests for
KafkaAdminClient#addRaftVoter and KafkaAdminClient#removeRaftVoter, to make sure they are sending
the right things.
Finally, I fixed some minor server-side bugs that were blocking the handling of these RPCs.
Firstly, ApiKeys.ADD_RAFT_VOTER and ApiKeys.REMOVE_RAFT_VOTER are now marked as forwardable so that
forwarding from the broker to the active controller works correctly. Secondly,
org.apache.kafka.raft.KafkaNetworkChannel has now been updated to enable API_VERSIONS_REQUEST and
API_VERSIONS_RESPONSE.
Co-authored-by: Murali Basani muralidhar.basani@aiven.io
Reviewers: José Armando García Sancio <jsancio@apache.org>, Alyssa Huang <ahuang@confluent.io>
2024-08-09 06:54:12 +08:00
implementation project ( ':metadata' )
2023-10-17 17:40:15 +08:00
implementation project ( ':storage' )
KAFKA-16523; kafka-metadata-quorum: support add-controller and remove-controller (#16774)
This PR adds support for add-controller and remove-controller in the kafka-metadata-quorum.sh
command-line tool. It also fixes some minor server-side bugs that blocked the tool from working.
In kafka-metadata-quorum.sh, the implementation of remove-controller is fairly straightforward. It
just takes some command-line flags and uses them to invoke AdminClient. The add-controller
implementation is a bit more complex because we have to look at the new controller's configuration
file. The parsing logic for the advertised.listeners and listeners server configurations that we
need was previously implemented in the :core module. However, the gradle module where
kafka-metadata-quorum.sh lives, :tools, cannot depend on :core. Therefore, I moved listener parsing
into SocketServerConfigs.listenerListToEndPoints. This will be a small step forward in our efforts
to move Kafka configuration out of :core.
I also made some minor changes in kafka-metadata-quorum.sh and Kafka-storage-tool.sh to handle
--help without displaying a backtrace on the screen, and give slightly better error messages on
stderr. Also, in DynamicVoter.toString, we now enclose the host in brackets if it contains a colon
(as IPV6 addresses can).
This PR fixes our handling of clusterId in addRaftVoter and removeRaftVoter, in two ways. Firstly,
it marks clusterId as nullable in the AddRaftVoterRequest.json and RemoveRaftVoterRequest.json
schemas, as it was always intended to be. Secondly, it allows AdminClient to optionally send
clusterId, by using AddRaftVoterOptions and RemoveRaftVoterOptions. We now also remember to
properly set timeoutMs in AddRaftVoterRequest. This PR adds unit tests for
KafkaAdminClient#addRaftVoter and KafkaAdminClient#removeRaftVoter, to make sure they are sending
the right things.
Finally, I fixed some minor server-side bugs that were blocking the handling of these RPCs.
Firstly, ApiKeys.ADD_RAFT_VOTER and ApiKeys.REMOVE_RAFT_VOTER are now marked as forwardable so that
forwarding from the broker to the active controller works correctly. Secondly,
org.apache.kafka.raft.KafkaNetworkChannel has now been updated to enable API_VERSIONS_REQUEST and
API_VERSIONS_RESPONSE.
Co-authored-by: Murali Basani muralidhar.basani@aiven.io
Reviewers: José Armando García Sancio <jsancio@apache.org>, Alyssa Huang <ahuang@confluent.io>
2024-08-09 06:54:12 +08:00
implementation project ( ':server' )
2022-08-20 23:37:26 +08:00
implementation project ( ':server-common' )
2023-08-12 03:05:51 +08:00
implementation project ( ':connect:runtime' )
2023-04-07 00:20:56 +08:00
implementation project ( ':tools:tools-api' )
2024-07-25 00:42:25 +08:00
implementation project ( ':transaction-coordinator' )
2024-07-31 15:18:14 +08:00
implementation project ( ':group-coordinator' )
2021-03-05 03:22:22 +08:00
implementation libs . argparse4j
2024-03-20 15:34:45 +08:00
implementation libs . jacksonDatabind
implementation libs . jacksonDataformatCsv
implementation libs . jacksonJDK8Datatypes
2021-04-16 02:37:15 +08:00
implementation libs . slf4jApi
2024-06-21 16:43:07 +08:00
implementation libs . slf4jReload4j
2023-02-02 18:23:26 +08:00
implementation libs . joptSimple
2021-04-16 02:37:15 +08:00
2021-10-29 02:36:53 +08:00
implementation libs . jose4j // for SASL/OAUTHBEARER JWT validation
2021-04-16 02:37:15 +08:00
implementation libs . jacksonJaxrsJsonProvider
testImplementation project ( ':clients' )
testImplementation project ( ':clients' ) . sourceSets . test . output
2024-02-13 11:02:36 +08:00
testImplementation project ( ':server' )
testImplementation project ( ':server' ) . sourceSets . test . output
2022-12-10 01:22:58 +08:00
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
testImplementation project ( ':server-common' )
testImplementation project ( ':server-common' ) . sourceSets . test . output
2023-08-12 03:05:51 +08:00
testImplementation project ( ':connect:api' )
testImplementation project ( ':connect:runtime' )
testImplementation project ( ':connect:runtime' ) . sourceSets . test . output
2023-10-04 00:03:38 +08:00
testImplementation project ( ':storage:storage-api' ) . sourceSets . main . output
2024-08-05 10:41:14 +08:00
testImplementation project ( ':storage' ) . sourceSets . test . output
2022-12-10 01:22:58 +08:00
testImplementation libs . junitJupiter
2023-09-24 21:01:28 +08:00
testImplementation libs . mockitoCore
2021-06-17 20:07:12 +08:00
testImplementation libs . mockitoJunitJupiter // supports MockitoExtension
2022-12-10 01:22:58 +08:00
testImplementation libs . bcpkix // required by the clients test module, but we have to specify it explicitly as gradle does not include the transitive test dependency automatically
2023-12-05 17:03:33 +08:00
testImplementation ( libs . jfreechart ) {
exclude group: 'junit' , module: 'junit'
}
2024-06-21 16:43:07 +08:00
testImplementation libs . reload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-04-16 02:37:15 +08:00
}
javadoc {
enabled = false
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
from ( configurations . testRuntimeClasspath ) {
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2021-04-16 02:37:15 +08:00
}
from ( configurations . runtimeClasspath ) {
exclude ( 'kafka-clients*' )
}
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
}
project ( ':trogdor' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "trogdor"
}
2021-04-16 02:37:15 +08:00
dependencies {
implementation project ( ':clients' )
implementation libs . argparse4j
2021-03-05 03:22:22 +08:00
implementation libs . jacksonDatabind
implementation libs . jacksonJDK8Datatypes
implementation libs . slf4jApi
implementation libs . jacksonJaxrsJsonProvider
implementation libs . jerseyContainerServlet
implementation libs . jerseyHk2
implementation libs . jaxbApi // Jersey dependency that was available in the JDK before Java 9
implementation libs . activation // Jersey dependency that was available in the JDK before Java 9
implementation libs . jettyServer
implementation libs . jettyServlet
implementation libs . jettyServlets
testImplementation project ( ':clients' )
testImplementation libs . junitJupiter
testImplementation project ( ':clients' ) . sourceSets . test . output
2023-09-24 21:01:28 +08:00
testImplementation libs . mockitoCore
2021-03-05 03:22:22 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2016-03-26 07:04:58 +08:00
}
2015-07-29 08:22:14 +08:00
2016-03-26 07:04:58 +08:00
javadoc {
2016-05-19 07:44:31 +08:00
enabled = false
2016-03-26 07:04:58 +08:00
}
2015-07-29 08:22:14 +08:00
2016-03-26 07:04:58 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2016-03-26 07:04:58 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2015-07-29 08:22:14 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2016-03-26 07:04:58 +08:00
exclude ( 'kafka-clients*' )
2015-07-29 08:22:14 +08:00
}
2016-03-26 07:04:58 +08:00
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
2015-09-26 08:27:58 +08:00
}
2021-02-10 06:11:35 +08:00
project ( ':shell' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-shell"
}
2021-02-10 06:11:35 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation libs . argparse4j
implementation libs . jacksonDatabind
implementation libs . jacksonJDK8Datatypes
implementation libs . jline
implementation libs . slf4jApi
2021-05-12 00:58:28 +08:00
implementation project ( ':server-common' )
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
implementation project ( ':core' )
implementation project ( ':metadata' )
implementation project ( ':raft' )
2021-02-10 06:11:35 +08:00
2021-10-29 02:36:53 +08:00
implementation libs . jose4j // for SASL/OAUTHBEARER JWT validation
2021-03-05 03:22:22 +08:00
implementation libs . jacksonJaxrsJsonProvider
2021-02-10 06:11:35 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' )
2023-12-11 11:18:34 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
testImplementation project ( ':server-common' )
testImplementation project ( ':server-common' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2021-02-10 06:11:35 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-02-10 06:11:35 +08:00
}
javadoc {
enabled = false
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2021-02-10 06:11:35 +08:00
include ( 'jline-*jar' )
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2021-02-10 06:11:35 +08:00
include ( 'jline-*jar' )
}
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
}
2015-09-26 08:27:58 +08:00
project ( ':streams' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams"
}
2019-09-28 03:12:30 +08:00
ext . buildStreamsVersionFileName = "kafka-streams-version.properties"
2015-09-26 08:27:58 +08:00
2022-04-21 23:25:20 +08:00
configurations {
generator
}
2016-03-26 07:04:58 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':clients' )
2021-03-18 22:00:22 +08:00
// `org.rocksdb.Options` is part of Kafka Streams public api via `RocksDBConfigSetter`
api libs . rocksDBJni
2021-04-07 08:47:52 +08:00
2021-03-05 03:22:22 +08:00
implementation libs . slf4jApi
implementation libs . jacksonAnnotations
implementation libs . jacksonDatabind
2016-11-18 06:43:00 +08:00
2018-04-05 09:54:40 +08:00
// testCompileOnly prevents streams from exporting a dependency on test-utils, which would cause a dependency cycle
testCompileOnly project ( ':streams:test-utils' )
2022-07-29 23:21:25 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
2024-04-16 15:28:35 +08:00
testImplementation project ( ':server' )
2021-03-05 03:22:22 +08:00
testImplementation project ( ':core' )
2023-03-28 20:43:22 +08:00
testImplementation project ( ':tools' )
2021-03-05 03:22:22 +08:00
testImplementation project ( ':core' ) . sourceSets . test . output
2024-03-05 18:11:56 +08:00
testImplementation project ( ':storage' )
2024-04-17 20:41:22 +08:00
testImplementation project ( ':group-coordinator' )
2024-04-13 00:29:51 +08:00
testImplementation project ( ':transaction-coordinator' )
2023-12-23 01:35:27 +08:00
testImplementation project ( ':server-common' )
2023-01-11 15:51:58 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2024-03-27 22:37:01 +08:00
testImplementation project ( ':server' )
2024-06-21 16:43:07 +08:00
testImplementation libs . reload4j
2022-07-29 23:21:25 +08:00
testImplementation libs . junitJupiter
2021-03-05 03:22:22 +08:00
testImplementation libs . bcpkix
testImplementation libs . hamcrest
2023-09-24 21:01:28 +08:00
testImplementation libs . mockitoCore
2023-03-21 04:49:35 +08:00
testImplementation libs . mockitoJunitJupiter // supports MockitoExtension
2024-06-24 13:06:35 +08:00
testImplementation libs . junitPlatformSuiteEngine // supports suite test
2024-04-17 20:41:22 +08:00
testImplementation project ( ':group-coordinator' )
2016-07-20 06:45:12 +08:00
2018-04-24 02:41:03 +08:00
testRuntimeOnly project ( ':streams:test-utils' )
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2022-04-21 23:25:20 +08:00
generator project ( ':generator' )
2016-03-26 07:04:58 +08:00
}
2015-09-26 08:27:58 +08:00
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
task processMessages ( type: JavaExec ) {
2022-04-21 23:25:20 +08:00
mainClass = "org.apache.kafka.message.MessageGenerator"
classpath = configurations . generator
2020-08-27 06:10:09 +08:00
args = [ "-p" , "org.apache.kafka.streams.internals.generated" ,
"-o" , "src/generated/java/org/apache/kafka/streams/internals/generated" ,
"-i" , "src/main/resources/common/message" ,
"-m" , "MessageDataGenerator"
]
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
inputs . dir ( "src/main/resources/common/message" )
2022-04-21 23:25:20 +08:00
. withPropertyName ( "messages" )
. withPathSensitivity ( PathSensitivity . RELATIVE )
outputs . cacheIf { true }
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
outputs . dir ( "src/generated/java/org/apache/kafka/streams/internals/generated" )
}
sourceSets {
main {
java {
srcDirs = [ "src/generated/java" , "src/main/java" ]
}
}
test {
java {
2024-03-14 17:36:46 +08:00
srcDirs = [ "src/test/java" ]
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
}
}
}
compileJava . dependsOn 'processMessages'
2023-02-28 23:16:09 +08:00
srcJar . dependsOn 'processMessages'
KAFKA-8868: Generate SubscriptionInfo protocol message (#7248)
Rather than maintain hand coded protocol serialization code, Streams could use the same code-generation framework as Clients/Core.
There isn't a perfect match, since the code generation framework includes an assumption that you're generating "protocol messages", rather than just arbitrary blobs, but I think it's close enough to justify using it, and improving it over time.
Using the code generation allows us to drop a lot of detail-oriented, brittle, and hard-to-maintain serialization logic in favor of a schema spec.
Reviewers: Colin P. McCabe <cmccabe@apache.org>, Boyang Chen <boyang@confluent.io>, Bill Bejeck <bill@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
2019-11-02 01:03:55 +08:00
2016-03-26 07:04:58 +08:00
javadoc {
include "**/org/apache/kafka/streams/**"
2021-03-09 22:00:16 +08:00
exclude "**/org/apache/kafka/streams/internals/**" , "**/org/apache/kafka/streams/**/internals/**"
2016-03-26 07:04:58 +08:00
}
2016-02-24 04:14:26 +08:00
2016-03-26 07:04:58 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2016-03-26 07:04:58 +08:00
exclude ( 'kafka-clients*' )
2016-02-24 04:14:26 +08:00
}
2016-03-26 07:04:58 +08:00
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
2022-02-09 03:03:19 +08:00
task createStreamsVersionFile ( ) {
2022-10-04 17:58:07 +08:00
def receiptFile = file ( "$buildDir/kafka/$buildStreamsVersionFileName" )
2022-04-21 23:25:20 +08:00
inputs . property "commitId" , commitId
inputs . property "version" , version
2019-09-28 03:12:30 +08:00
outputs . file receiptFile
2022-04-21 23:25:20 +08:00
2019-09-28 03:12:30 +08:00
doLast {
def data = [
commitId: commitId ,
version: version ,
]
receiptFile . parentFile . mkdirs ( )
def content = data . entrySet ( ) . collect { "$it.key=$it.value" } . sort ( ) . join ( "\n" )
receiptFile . setText ( content , "ISO-8859-1" )
}
}
2016-03-26 07:04:58 +08:00
jar {
2019-09-28 03:12:30 +08:00
dependsOn 'createStreamsVersionFile'
from ( "$buildDir" ) {
include "kafka/$buildStreamsVersionFileName"
}
2016-03-26 07:04:58 +08:00
dependsOn 'copyDependantLibs'
}
systemTestLibs {
dependsOn testJar
}
task genStreamsConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.streams.StreamsConfig'
2016-03-26 07:04:58 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "streams_config.html" ) . newOutputStream ( )
}
2020-07-25 04:30:20 +08:00
task testAll (
dependsOn: [
':streams:test' ,
':streams:test-utils:test' ,
':streams:streams-scala:test' ,
':streams:upgrade-system-tests-0100:test' ,
':streams:upgrade-system-tests-0101:test' ,
':streams:upgrade-system-tests-0102:test' ,
':streams:upgrade-system-tests-0110:test' ,
':streams:upgrade-system-tests-10:test' ,
':streams:upgrade-system-tests-11:test' ,
':streams:upgrade-system-tests-20:test' ,
':streams:upgrade-system-tests-21:test' ,
':streams:upgrade-system-tests-22:test' ,
':streams:upgrade-system-tests-23:test' ,
':streams:upgrade-system-tests-24:test' ,
':streams:upgrade-system-tests-25:test' ,
2020-08-05 07:04:52 +08:00
':streams:upgrade-system-tests-26:test' ,
2020-12-23 06:34:59 +08:00
':streams:upgrade-system-tests-27:test' ,
2021-08-05 06:31:10 +08:00
':streams:upgrade-system-tests-28:test' ,
2022-01-28 17:06:31 +08:00
':streams:upgrade-system-tests-30:test' ,
':streams:upgrade-system-tests-31:test' ,
2022-06-21 22:33:40 +08:00
':streams:upgrade-system-tests-32:test' ,
2023-01-10 15:37:05 +08:00
':streams:upgrade-system-tests-33:test' ,
2023-10-23 16:33:59 +08:00
':streams:upgrade-system-tests-34:test' ,
2023-10-23 19:26:50 +08:00
':streams:upgrade-system-tests-35:test' ,
2024-01-27 06:59:24 +08:00
':streams:upgrade-system-tests-36:test' ,
2024-03-07 04:02:58 +08:00
':streams:upgrade-system-tests-37:test' ,
2024-07-31 01:04:38 +08:00
':streams:upgrade-system-tests-38:test' ,
2020-07-25 04:30:20 +08:00
':streams:examples:test'
]
)
2015-07-29 08:22:14 +08:00
}
2018-04-24 04:33:35 +08:00
project ( ':streams:streams-scala' ) {
apply plugin: 'scala'
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-scala_${versions.baseScala}"
}
2018-04-24 04:33:35 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':streams' )
2018-04-24 04:33:35 +08:00
2021-03-05 03:22:22 +08:00
api libs . scalaLibrary
2024-02-09 18:57:32 +08:00
if ( versions . baseScala = = '2.12' ) {
// Scala-Collection-Compat isn't required when compiling with Scala 2.13 or later,
// and having it in the dependencies could lead to classpath conflicts in Scala 3
// projects that use kafka-streams-kafka_2.13 (because we don't have a Scala 3 version yet)
// but also pull in scala-collection-compat_3 via another dependency.
// So we make sure to not include it in the dependencies.
api libs . scalaCollectionCompat
}
2024-04-17 20:41:22 +08:00
testImplementation project ( ':group-coordinator' )
2021-03-05 03:22:22 +08:00
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
2023-01-11 15:51:58 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
testImplementation project ( ':streams' ) . sourceSets . test . output
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation project ( ':streams:test-utils' )
2018-04-24 04:33:35 +08:00
2021-03-25 01:04:39 +08:00
testImplementation libs . junitJupiter
2024-02-27 10:52:25 +08:00
testImplementation libs . mockitoCore
testImplementation libs . mockitoJunitJupiter // supports MockitoExtension
2021-03-05 03:22:22 +08:00
testImplementation libs . hamcrest
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2018-04-24 04:33:35 +08:00
}
javadoc {
include "**/org/apache/kafka/streams/scala/**"
}
2023-02-01 01:00:48 +08:00
scaladoc {
scalaDocOptions . additionalParameters = [ "-no-link-warnings" ]
}
2018-04-24 04:33:35 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2018-04-24 04:33:35 +08:00
exclude ( 'kafka-streams*' )
}
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
2023-02-27 16:28:19 +08:00
// spotless 6.14 requires Java 11 at runtime
if ( JavaVersion . current ( ) . isJava11Compatible ( ) ) {
apply plugin: 'com.diffplug.spotless'
spotless {
scala {
target '**/*.scala'
scalafmt ( "$versions.scalafmt" ) . configFile ( '../../checkstyle/.scalafmt.conf' ) . scalaMajorVersion ( versions . baseScala )
licenseHeaderFile '../../checkstyle/java.header' , 'package'
}
}
}
2018-04-24 04:33:35 +08:00
}
2018-01-30 09:21:48 +08:00
project ( ':streams:test-utils' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-test-utils"
}
2018-01-30 09:21:48 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':streams' )
api project ( ':clients' )
implementation libs . slf4jApi
2018-01-30 09:21:48 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . junitJupiter
2021-08-04 08:26:46 +08:00
testImplementation libs . mockitoCore
2021-03-05 03:22:22 +08:00
testImplementation libs . hamcrest
2018-01-30 09:21:48 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2018-01-30 09:21:48 +08:00
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2018-01-30 09:21:48 +08:00
exclude ( 'kafka-streams*' )
}
into "$buildDir/dependant-libs-${versions.scala}"
duplicatesStrategy 'exclude'
}
jar {
dependsOn 'copyDependantLibs'
}
}
2016-01-23 07:25:24 +08:00
project ( ':streams:examples' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-examples"
}
2016-01-23 07:25:24 +08:00
dependencies {
2021-04-07 08:47:52 +08:00
// this dependency should be removed after we unify data API
implementation ( project ( ':connect:json' ) ) {
// this transitive dependency is not used in Streams, and it breaks SBT builds
exclude module: 'javax.ws.rs-api'
}
2021-03-05 03:22:22 +08:00
implementation project ( ':streams' )
2021-04-07 08:47:52 +08:00
2024-06-21 16:43:07 +08:00
implementation libs . slf4jReload4j
2018-03-28 05:03:24 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':streams:test-utils' )
testImplementation project ( ':clients' ) . sourceSets . test . output // for org.apache.kafka.test.IntegrationTest
testImplementation libs . junitJupiter
testImplementation libs . hamcrest
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2016-01-23 07:25:24 +08:00
}
javadoc {
enabled = false
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2016-01-23 07:25:24 +08:00
exclude ( 'kafka-streams*' )
}
into "$buildDir/dependant-libs-${versions.scala}"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2016-01-23 07:25:24 +08:00
}
jar {
dependsOn 'copyDependantLibs'
}
}
2018-04-07 08:00:52 +08:00
project ( ':streams:upgrade-system-tests-0100' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-0100"
}
2018-04-07 08:00:52 +08:00
dependencies {
2022-05-11 11:14:21 +08:00
testImplementation ( libs . kafkaStreams_0100 ) {
exclude group: 'org.slf4j' , module: 'slf4j-log4j12'
exclude group: 'log4j' , module: 'log4j'
}
2021-03-05 03:22:22 +08:00
testRuntimeOnly libs . junitJupiter
2018-04-07 08:00:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
project ( ':streams:upgrade-system-tests-0101' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-0101"
}
2018-04-07 08:00:52 +08:00
dependencies {
2022-05-11 11:14:21 +08:00
testImplementation ( libs . kafkaStreams_0101 ) {
exclude group: 'org.slf4j' , module: 'slf4j-log4j12'
exclude group: 'log4j' , module: 'log4j'
}
2021-03-05 03:22:22 +08:00
testRuntimeOnly libs . junitJupiter
2018-04-07 08:00:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
project ( ':streams:upgrade-system-tests-0102' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-0102"
}
2018-04-07 08:00:52 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_0102
testRuntimeOnly libs . junitJupiter
2018-04-07 08:00:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
project ( ':streams:upgrade-system-tests-0110' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-0110"
}
2018-04-07 08:00:52 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_0110
testRuntimeOnly libs . junitJupiter
2018-04-07 08:00:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
project ( ':streams:upgrade-system-tests-10' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-10"
}
2018-04-07 08:00:52 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_10
testRuntimeOnly libs . junitJupiter
2018-04-07 08:00:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2018-04-18 15:38:27 +08:00
project ( ':streams:upgrade-system-tests-11' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-11"
}
2018-04-18 15:38:27 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_11
testRuntimeOnly libs . junitJupiter
2018-04-18 15:38:27 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
MINOR: Enable ignored upgrade system tests - trunk (#5605)
Removed ignore annotations from the upgrade tests. This PR includes the following changes for updating the upgrade tests:
* Uploaded new versions 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, and 2.0.0 (in the associated scala versions) to kafka-packages
* Update versions in version.py, Dockerfile, base.sh
* Added new versions to StreamsUpgradeTest.test_upgrade_downgrade_brokers including version 2.0.0
* Added new versions StreamsUpgradeTest.test_simple_upgrade_downgrade test excluding version 2.0.0
* Version 2.0.0 is excluded from the streams upgrade/downgrade test as StreamsConfig needs an update for the new version, requiring a KIP. Once the community votes the KIP in, a minor follow-up PR can be pushed to add the 2.0.0 version to the upgrade test.
* Fixed minor bug in kafka-run-class.sh for classpath in upgrade/downgrade tests across versions.
* Follow on PRs for 0.10.2x, 0.11.0x, 1.0.x, 1.1.x, and 2.0.x will be pushed soon with the same updates required for the specific version.
Reviewers: Eno Thereska <eno.thereska@gmail.com>, John Roesler <vvcephei@users.noreply.github.com>, Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2018-09-14 04:46:47 +08:00
project ( ':streams:upgrade-system-tests-20' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-20"
}
MINOR: Enable ignored upgrade system tests - trunk (#5605)
Removed ignore annotations from the upgrade tests. This PR includes the following changes for updating the upgrade tests:
* Uploaded new versions 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, and 2.0.0 (in the associated scala versions) to kafka-packages
* Update versions in version.py, Dockerfile, base.sh
* Added new versions to StreamsUpgradeTest.test_upgrade_downgrade_brokers including version 2.0.0
* Added new versions StreamsUpgradeTest.test_simple_upgrade_downgrade test excluding version 2.0.0
* Version 2.0.0 is excluded from the streams upgrade/downgrade test as StreamsConfig needs an update for the new version, requiring a KIP. Once the community votes the KIP in, a minor follow-up PR can be pushed to add the 2.0.0 version to the upgrade test.
* Fixed minor bug in kafka-run-class.sh for classpath in upgrade/downgrade tests across versions.
* Follow on PRs for 0.10.2x, 0.11.0x, 1.0.x, 1.1.x, and 2.0.x will be pushed soon with the same updates required for the specific version.
Reviewers: Eno Thereska <eno.thereska@gmail.com>, John Roesler <vvcephei@users.noreply.github.com>, Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2018-09-14 04:46:47 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_20
testRuntimeOnly libs . junitJupiter
MINOR: Enable ignored upgrade system tests - trunk (#5605)
Removed ignore annotations from the upgrade tests. This PR includes the following changes for updating the upgrade tests:
* Uploaded new versions 0.10.2.2, 0.11.0.3, 1.0.2, 1.1.1, and 2.0.0 (in the associated scala versions) to kafka-packages
* Update versions in version.py, Dockerfile, base.sh
* Added new versions to StreamsUpgradeTest.test_upgrade_downgrade_brokers including version 2.0.0
* Added new versions StreamsUpgradeTest.test_simple_upgrade_downgrade test excluding version 2.0.0
* Version 2.0.0 is excluded from the streams upgrade/downgrade test as StreamsConfig needs an update for the new version, requiring a KIP. Once the community votes the KIP in, a minor follow-up PR can be pushed to add the 2.0.0 version to the upgrade test.
* Fixed minor bug in kafka-run-class.sh for classpath in upgrade/downgrade tests across versions.
* Follow on PRs for 0.10.2x, 0.11.0x, 1.0.x, 1.1.x, and 2.0.x will be pushed soon with the same updates required for the specific version.
Reviewers: Eno Thereska <eno.thereska@gmail.com>, John Roesler <vvcephei@users.noreply.github.com>, Guozhang Wang <wangguoz@gmail.com>, Matthias J. Sax <matthias@confluent.io>
2018-09-14 04:46:47 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2019-01-07 15:03:54 +08:00
project ( ':streams:upgrade-system-tests-21' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-21"
}
2019-01-07 15:03:54 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_21
testRuntimeOnly libs . junitJupiter
2019-01-07 15:03:54 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2019-06-04 12:09:58 +08:00
project ( ':streams:upgrade-system-tests-22' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-22"
}
2019-06-04 12:09:58 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_22
testRuntimeOnly libs . junitJupiter
2019-06-04 12:09:58 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2019-08-22 01:26:57 +08:00
project ( ':streams:upgrade-system-tests-23' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-23"
}
2019-08-22 01:26:57 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_23
testRuntimeOnly libs . junitJupiter
2019-08-22 01:26:57 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2019-12-21 06:21:12 +08:00
project ( ':streams:upgrade-system-tests-24' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-24"
}
2019-12-21 06:21:12 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_24
testRuntimeOnly libs . junitJupiter
2019-12-21 06:21:12 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2020-04-16 06:59:03 +08:00
project ( ':streams:upgrade-system-tests-25' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-25"
}
2020-04-16 06:59:03 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_25
testRuntimeOnly libs . junitJupiter
2020-04-16 06:59:03 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2020-08-05 07:04:52 +08:00
project ( ':streams:upgrade-system-tests-26' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-26"
}
2020-08-05 07:04:52 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_26
testRuntimeOnly libs . junitJupiter
2020-08-05 07:04:52 +08:00
}
systemTestLibs {
dependsOn testJar
}
}
2020-12-23 06:34:59 +08:00
project ( ':streams:upgrade-system-tests-27' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-27"
}
2020-12-23 06:34:59 +08:00
2021-01-19 00:59:09 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
testImplementation libs . kafkaStreams_27
testRuntimeOnly libs . junitJupiter
2021-01-19 00:59:09 +08:00
}
2020-12-23 06:34:59 +08:00
2021-01-19 00:59:09 +08:00
systemTestLibs {
dependsOn testJar
}
2020-12-23 06:34:59 +08:00
}
2021-08-05 06:31:10 +08:00
project ( ':streams:upgrade-system-tests-28' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-28"
}
2021-08-05 06:31:10 +08:00
dependencies {
testImplementation libs . kafkaStreams_28
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2022-01-28 17:06:31 +08:00
project ( ':streams:upgrade-system-tests-30' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-30"
}
2022-01-28 17:06:31 +08:00
dependencies {
testImplementation libs . kafkaStreams_30
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
project ( ':streams:upgrade-system-tests-31' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-31"
}
2022-01-28 17:06:31 +08:00
dependencies {
testImplementation libs . kafkaStreams_31
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2022-06-21 22:33:40 +08:00
project ( ':streams:upgrade-system-tests-32' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-32"
}
2022-06-21 22:33:40 +08:00
dependencies {
testImplementation libs . kafkaStreams_32
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2023-01-10 15:37:05 +08:00
project ( ':streams:upgrade-system-tests-33' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-33"
}
2023-01-10 15:37:05 +08:00
dependencies {
testImplementation libs . kafkaStreams_33
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2023-10-23 16:33:59 +08:00
project ( ':streams:upgrade-system-tests-34' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-34"
}
2023-10-23 16:33:59 +08:00
dependencies {
testImplementation libs . kafkaStreams_34
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2023-10-23 19:26:50 +08:00
project ( ':streams:upgrade-system-tests-35' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-35"
}
2023-10-23 19:26:50 +08:00
dependencies {
testImplementation libs . kafkaStreams_35
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2024-01-27 06:59:24 +08:00
project ( ':streams:upgrade-system-tests-36' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-36"
}
2024-01-27 06:59:24 +08:00
dependencies {
testImplementation libs . kafkaStreams_36
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2024-03-07 04:02:58 +08:00
project ( ':streams:upgrade-system-tests-37' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-streams-upgrade-system-tests-37"
}
2024-03-07 04:02:58 +08:00
dependencies {
testImplementation libs . kafkaStreams_37
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2024-07-31 01:04:38 +08:00
project ( ':streams:upgrade-system-tests-38' ) {
base {
archivesName = "kafka-streams-upgrade-system-tests-38"
}
dependencies {
testImplementation libs . kafkaStreams_38
testRuntimeOnly libs . junitJupiter
}
systemTestLibs {
dependsOn testJar
}
}
2017-03-06 18:47:36 +08:00
project ( ':jmh-benchmarks' ) {
2024-09-18 03:05:25 +08:00
apply plugin: 'com.github.johnrengelman.shadow'
2017-03-06 18:47:36 +08:00
shadowJar {
2021-03-05 03:22:22 +08:00
archiveBaseName = 'kafka-jmh-benchmarks'
2017-03-06 18:47:36 +08:00
}
dependencies {
2021-03-05 03:22:22 +08:00
implementation ( project ( ':core' ) ) {
2020-12-11 09:56:52 +08:00
// jmh requires jopt 4.x while `core` depends on 5.0, they are not binary compatible
exclude group: 'net.sf.jopt-simple' , module: 'jopt-simple'
}
2022-05-03 07:27:52 +08:00
implementation project ( ':server-common' )
2024-03-27 22:37:01 +08:00
implementation project ( ':server' )
2024-04-27 07:02:31 +08:00
implementation project ( ':raft' )
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
2023-01-20 15:38:21 +08:00
implementation project ( ':group-coordinator' )
2024-06-07 03:19:20 +08:00
implementation project ( ':group-coordinator:group-coordinator-api' )
2021-03-05 03:22:22 +08:00
implementation project ( ':metadata' )
2022-12-22 08:57:02 +08:00
implementation project ( ':storage' )
2021-03-05 03:22:22 +08:00
implementation project ( ':streams' )
implementation project ( ':core' )
2023-06-02 03:14:31 +08:00
implementation project ( ':connect:api' )
implementation project ( ':connect:transforms' )
2023-12-25 04:47:12 +08:00
implementation project ( ':connect:json' )
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' ) . sourceSets . test . output
implementation project ( ':core' ) . sourceSets . test . output
2023-06-09 14:54:25 +08:00
implementation project ( ':server-common' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
implementation libs . jmhCore
2018-09-04 01:21:48 +08:00
annotationProcessor libs . jmhGeneratorAnnProcess
2021-03-05 03:22:22 +08:00
implementation libs . jmhCoreBenchmarks
implementation libs . jacksonDatabind
implementation libs . metrics
implementation libs . mockitoCore
2024-06-21 16:43:07 +08:00
implementation libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
implementation libs . scalaLibrary
implementation libs . scalaJava8Compat
2017-03-06 18:47:36 +08:00
}
2020-12-11 09:56:52 +08:00
tasks . withType ( JavaCompile ) {
// Suppress warning caused by code generated by jmh: `warning: [cast] redundant cast to long`
options . compilerArgs < < "-Xlint:-cast"
}
2017-03-06 18:47:36 +08:00
jar {
manifest {
attributes "Main-Class" : "org.openjdk.jmh.Main"
}
}
KAFKA-8841; Reduce overhead of ReplicaManager.updateFollowerFetchState (#7324)
This PR makes two changes to code in the ReplicaManager.updateFollowerFetchState path, which is in the hot path for follower fetches. Although calling ReplicaManager.updateFollowerFetch state is inexpensive on its own, it is called once for each partition every time a follower fetch occurs.
1. updateFollowerFetchState no longer calls maybeExpandIsr when the follower is already in the ISR. This avoid repeated expansion checks.
2. Partition.maybeIncrementLeaderHW is also in the hot path for ReplicaManager.updateFollowerFetchState. Partition.maybeIncrementLeaderHW calls Partition.remoteReplicas four times each iteration, and it performs a toSet conversion. maybeIncrementLeaderHW now avoids generating any intermediate collections when updating the HWM.
**Benchmark results for Partition.updateFollowerFetchState on a r5.xlarge:**
Old:
```
1288.633 ±(99.9%) 1.170 ns/op [Average]
(min, avg, max) = (1287.343, 1288.633, 1290.398), stdev = 1.037
CI (99.9%): [1287.463, 1289.802] (assumes normal distribution)
```
New (when follower fetch offset is updated):
```
261.727 ±(99.9%) 0.122 ns/op [Average]
(min, avg, max) = (261.565, 261.727, 261.937), stdev = 0.114
CI (99.9%): [261.605, 261.848] (assumes normal distribution)
```
New (when follower fetch offset is the same):
```
68.484 ±(99.9%) 0.025 ns/op [Average]
(min, avg, max) = (68.446, 68.484, 68.520), stdev = 0.023
CI (99.9%): [68.460, 68.509] (assumes normal distribution)
```
Reviewers: Ismael Juma <ismael@juma.me.uk>, Jason Gustafson <jason@confluent.io>
2019-09-19 00:11:39 +08:00
checkstyle {
configProperties = checkstyleConfigProperties ( "import-control-jmh-benchmarks.xml" )
}
2017-03-06 18:47:36 +08:00
task jmh ( type: JavaExec , dependsOn: [ ':jmh-benchmarks:clean' , ':jmh-benchmarks:shadowJar' ] ) {
2022-04-21 23:25:20 +08:00
mainClass = "-jar"
2017-03-06 18:47:36 +08:00
doFirst {
if ( System . getProperty ( "jmhArgs" ) ) {
2020-03-17 00:30:48 +08:00
args System . getProperty ( "jmhArgs" ) . split ( ' ' )
2017-03-06 18:47:36 +08:00
}
args = [ shadowJar . archivePath , * args ]
}
}
javadoc {
enabled = false
}
}
2015-07-07 07:36:20 +08:00
project ( ':log4j-appender' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "kafka-log4j-appender"
}
2015-07-07 07:36:20 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
2024-06-21 16:43:07 +08:00
implementation libs . slf4jReload4j
2015-07-07 07:36:20 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation libs . junitJupiter
testImplementation libs . hamcrest
2021-06-30 16:25:08 +08:00
testImplementation libs . mockitoCore
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2015-07-07 07:36:20 +08:00
}
javadoc {
2016-05-19 07:44:31 +08:00
enabled = false
2015-07-07 07:36:20 +08:00
}
2016-05-19 07:44:31 +08:00
2014-02-08 05:48:04 +08:00
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
2015-11-13 03:11:56 +08:00
project ( ':connect:api' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-api"
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':clients' )
implementation libs . slf4jApi
implementation libs . jaxrsApi
2016-01-12 06:16:58 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
javadoc {
2020-04-20 10:24:21 +08:00
include "**/org/apache/kafka/connect/**" // needed for the `aggregatedJavadoc` task
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2015-10-31 06:00:00 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2015-10-31 06:00:00 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2015-10-31 06:00:00 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2015-10-31 06:00:00 +08:00
exclude ( 'kafka-clients*' )
2015-11-09 14:11:03 +08:00
exclude ( 'connect-*' )
2015-10-31 06:00:00 +08:00
}
into "$buildDir/dependant-libs"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-10-31 06:00:00 +08:00
}
jar {
dependsOn copyDependantLibs
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2017-01-13 08:14:53 +08:00
project ( ':connect:transforms' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-transforms"
}
2017-01-13 08:14:53 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':connect:api' )
2021-03-18 22:27:14 +08:00
2021-03-05 03:22:22 +08:00
implementation libs . slf4jApi
2017-01-13 08:14:53 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2017-01-13 08:14:53 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
2017-01-13 08:14:53 +08:00
}
javadoc {
enabled = false
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2017-01-13 08:14:53 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2017-01-13 08:14:53 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2017-01-13 08:14:53 +08:00
exclude ( 'kafka-clients*' )
exclude ( 'connect-*' )
}
into "$buildDir/dependant-libs"
duplicatesStrategy 'exclude'
}
jar {
dependsOn copyDependantLibs
}
}
2015-11-13 03:11:56 +08:00
project ( ':connect:json' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-json"
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
api project ( ':connect:api' )
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
2021-03-05 03:22:22 +08:00
api libs . jacksonDatabind
api libs . jacksonJDK8Datatypes
2023-12-25 04:47:12 +08:00
api libs . jacksonAfterburner
2016-01-12 06:16:58 +08:00
2021-03-05 03:22:22 +08:00
implementation libs . slf4jApi
2024-03-27 22:37:01 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
javadoc {
2015-11-30 05:26:32 +08:00
enabled = false
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2015-10-31 06:00:00 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2015-10-31 06:00:00 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2015-10-31 06:00:00 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2015-10-31 06:00:00 +08:00
exclude ( 'kafka-clients*' )
2015-11-09 14:11:03 +08:00
exclude ( 'connect-*' )
2015-10-31 06:00:00 +08:00
}
into "$buildDir/dependant-libs"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-10-31 06:00:00 +08:00
}
jar {
dependsOn copyDependantLibs
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2015-11-13 03:11:56 +08:00
project ( ':connect:runtime' ) {
2022-09-13 00:33:13 +08:00
configurations {
swagger
}
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-runtime"
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
// connect-runtime is used in tests, use `api` for modules below for backwards compatibility even though
// applications should generally not depend on `connect-runtime`
api project ( ':connect:api' )
api project ( ':clients' )
api project ( ':connect:json' )
api project ( ':connect:transforms' )
implementation libs . slf4jApi
2024-06-21 16:43:07 +08:00
implementation libs . reload4j
2021-10-29 02:36:53 +08:00
implementation libs . jose4j // for SASL/OAUTHBEARER JWT validation
2021-03-05 03:22:22 +08:00
implementation libs . jacksonAnnotations
implementation libs . jacksonJaxrsJsonProvider
implementation libs . jerseyContainerServlet
implementation libs . jerseyHk2
implementation libs . jaxbApi // Jersey dependency that was available in the JDK before Java 9
implementation libs . activation // Jersey dependency that was available in the JDK before Java 9
implementation libs . jettyServer
implementation libs . jettyServlet
implementation libs . jettyServlets
implementation libs . jettyClient
implementation libs . reflections
implementation libs . mavenArtifact
2022-06-10 17:35:22 +08:00
implementation libs . swaggerAnnotations
2021-03-05 03:22:22 +08:00
2022-09-13 00:33:13 +08:00
// We use this library to generate OpenAPI docs for the REST API, but we don't want or need it at compile
// or run time. So, we add it to a separate configuration, which we use later on during docs generation
swagger libs . swaggerJaxrs2
2022-09-09 22:49:29 +08:00
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation project ( ':core' )
2024-04-16 15:28:35 +08:00
testImplementation project ( ':server' )
2021-03-05 03:22:22 +08:00
testImplementation project ( ':metadata' )
2024-07-29 22:43:55 +08:00
testImplementation project ( ':server-common' )
2021-03-05 03:22:22 +08:00
testImplementation project ( ':core' ) . sourceSets . test . output
2023-08-17 01:30:24 +08:00
testImplementation project ( ':server-common' )
2024-03-27 22:37:01 +08:00
testImplementation project ( ':server' )
2024-04-17 20:41:22 +08:00
testImplementation project ( ':group-coordinator' )
2024-03-05 18:11:56 +08:00
testImplementation project ( ':storage' )
2023-08-17 01:30:24 +08:00
testImplementation project ( ':connect:test-plugins' )
2024-07-29 22:43:55 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2024-06-13 16:11:37 +08:00
testImplementation libs . junitJupiter
2023-09-24 21:01:28 +08:00
testImplementation libs . mockitoCore
2024-06-13 16:11:37 +08:00
testImplementation libs . hamcrest
testImplementation libs . mockitoJunitJupiter
2021-03-05 03:22:22 +08:00
testImplementation libs . httpclient
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2022-11-18 06:51:54 +08:00
testRuntimeOnly libs . bcpkix
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
javadoc {
2015-11-30 05:26:32 +08:00
enabled = false
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2015-10-31 06:00:00 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2022-05-11 11:14:21 +08:00
// No need to copy log4j since the module has an explicit dependency on that
2015-10-31 06:00:00 +08:00
include ( 'slf4j-log4j12*' )
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2015-10-31 06:00:00 +08:00
exclude ( 'kafka-clients*' )
2015-11-09 14:11:03 +08:00
exclude ( 'connect-*' )
2015-10-31 06:00:00 +08:00
}
into "$buildDir/dependant-libs"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-10-31 06:00:00 +08:00
}
jar {
dependsOn copyDependantLibs
}
2016-03-10 13:55:05 +08:00
task genConnectConfigDocs ( type: JavaExec ) {
2015-11-10 08:29:30 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.runtime.distributed.DistributedConfig'
2016-03-10 13:13:54 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "connect_config.html" ) . newOutputStream ( )
2015-11-10 08:29:30 +08:00
}
2017-01-21 08:15:15 +08:00
2018-08-08 05:34:27 +08:00
task genSinkConnectorConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.runtime.SinkConnectorConfig'
2018-08-08 05:34:27 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "sink_connector_config.html" ) . newOutputStream ( )
}
task genSourceConnectorConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.runtime.SourceConnectorConfig'
2018-08-08 05:34:27 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "source_connector_config.html" ) . newOutputStream ( )
}
2017-01-21 08:15:15 +08:00
task genConnectTransformationDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.tools.TransformationDoc'
2017-01-21 08:15:15 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "connect_transforms.html" ) . newOutputStream ( )
}
2017-10-05 02:05:50 +08:00
2020-06-16 13:07:01 +08:00
task genConnectPredicateDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.tools.PredicateDoc'
2020-06-16 13:07:01 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "connect_predicates.html" ) . newOutputStream ( )
}
2017-10-05 02:05:50 +08:00
task genConnectMetricsDocs ( type: JavaExec ) {
2024-03-06 17:19:54 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-04-21 23:25:20 +08:00
mainClass = 'org.apache.kafka.connect.runtime.ConnectMetrics'
2017-10-05 02:05:50 +08:00
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "connect_metrics.html" ) . newOutputStream ( )
}
2022-06-10 17:35:22 +08:00
task setVersionInOpenAPISpec ( type: Copy ) {
from "$rootDir/gradle/openapi.template"
into "$buildDir/resources/docs"
rename ( 'openapi.template' , 'openapi.yaml' )
expand ( kafkaVersion: "$rootProject.version" )
}
task genConnectOpenAPIDocs ( type: io . swagger . v3 . plugins . gradle . tasks . ResolveTask , dependsOn: setVersionInOpenAPISpec ) {
2022-09-13 00:33:13 +08:00
classpath = sourceSets . main . runtimeClasspath
2022-09-09 22:49:29 +08:00
2023-02-06 18:28:02 +08:00
buildClasspath = classpath + configurations . swagger
2022-06-10 17:35:22 +08:00
outputFileName = 'connect_rest'
outputFormat = 'YAML'
prettyPrint = 'TRUE'
sortOutput = 'TRUE'
openApiFile = file ( "$buildDir/resources/docs/openapi.yaml" )
resourcePackages = [ 'org.apache.kafka.connect.runtime.rest.resources' ]
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
outputDir = file ( generatedDocsDir )
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
}
2015-11-13 03:11:56 +08:00
project ( ':connect:file' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-file"
}
KAFKA-2366; Initial patch for Copycat
This is an initial patch implementing the basics of Copycat for KIP-26.
The intent here is to start a review of the key pieces of the core API and get a reasonably functional, baseline, non-distributed implementation of Copycat in place to get things rolling. The current patch has a number of known issues that need to be addressed before a final version:
* Some build-related issues. Specifically, requires some locally-installed dependencies (see below), ignores checkstyle for the runtime data library because it's lifted from Avro currently and likely won't last in its current form, and some Gradle task dependencies aren't quite right because I haven't gotten rid of the dependency on `core` (which should now be an easy patch since new consumer groups are in a much better state).
* This patch currently depends on some Confluent trunk code because I prototyped with our Avro serializers w/ schema-registry support. We need to figure out what we want to provide as an example built-in set of serializers. Unlike core Kafka where we could ignore the issue, providing only ByteArray or String serializers, this is pretty central to how Copycat works.
* This patch uses a hacked up version of Avro as its runtime data format. Not sure if we want to go through the entire API discussion just to get some basic code committed, so I filed KAFKA-2367 to handle that separately. The core connector APIs and the runtime data APIs are entirely orthogonal.
* This patch needs some updates to get aligned with recent new consumer changes (specifically, I'm aware of the ConcurrentModificationException issue on exit). More generally, the new consumer is in flux but Copycat depends on it, so there are likely to be some negative interactions.
* The layout feels a bit awkward to me right now because I ported it from a Maven layout. We don't have nearly the same level of granularity in Kafka currently (core and clients, plus the mostly ignored examples, log4j-appender, and a couple of contribs). We might want to reorganize, although keeping data+api separate from runtime and connector plugins is useful for minimizing dependencies.
* There are a variety of other things (e.g., I'm not happy with the exception hierarchy/how they are currently handled, TopicPartition doesn't really need to be duplicated unless we want Copycat entirely isolated from the Kafka APIs, etc), but I expect those we'll cover in the review.
Before commenting on the patch, it's probably worth reviewing https://issues.apache.org/jira/browse/KAFKA-2365 and https://issues.apache.org/jira/browse/KAFKA-2366 to get an idea of what I had in mind for a) what we ultimately want with all the Copycat patches and b) what we aim to cover in this initial patch. My hope is that we can use a WIP patch (after the current obvious deficiencies are addressed) while recognizing that we want to make iterative progress with a bunch of subsequent PRs.
Author: Ewen Cheslack-Postava <me@ewencp.org>
Reviewers: Ismael Juma, Gwen Shapira
Closes #99 from ewencp/copycat and squashes the following commits:
a3a47a6 [Ewen Cheslack-Postava] Simplify Copycat exceptions, make them a subclass of KafkaException.
8c108b0 [Ewen Cheslack-Postava] Rename Coordinator to Herder to avoid confusion with the consumer coordinator.
7bf8075 [Ewen Cheslack-Postava] Make Copycat CLI speific to standalone mode, clean up some config and get rid of config storage in standalone mode.
656a003 [Ewen Cheslack-Postava] Clarify and expand the explanation of the Copycat Coordinator interface.
c0e5fdc [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
0fa7a36 [Ewen Cheslack-Postava] Mark Copycat classes as unstable and reduce visibility of some classes where possible.
d55d31e [Ewen Cheslack-Postava] Reorganize Copycat code to put it all under one top-level directory.
b29cb2c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
d713a21 [Ewen Cheslack-Postava] Address Gwen's review comments.
6787a85 [Ewen Cheslack-Postava] Make Converter generic to match serializers since some serialization formats do not require a base class of Object; update many other classes to have generic key and value class type parameters to match this change.
b194c73 [Ewen Cheslack-Postava] Split Copycat converter option into two options for key and value.
0b5a1a0 [Ewen Cheslack-Postava] Normalize naming to use partition for both source and Kafka, adjusting naming in CopycatRecord classes to clearly differentiate.
e345142 [Ewen Cheslack-Postava] Remove Copycat reflection utils, use existing Utils and ConfigDef functionality from clients package.
be5c387 [Ewen Cheslack-Postava] Minor cleanup
122423e [Ewen Cheslack-Postava] Style cleanup
6ba87de [Ewen Cheslack-Postava] Remove most of the Avro-based mock runtime data API, only preserving enough schema functionality to support basic primitive types for an initial patch.
4674d13 [Ewen Cheslack-Postava] Address review comments, clean up some code styling.
25b5739 [Ewen Cheslack-Postava] Fix sink task offset commit concurrency issue by moving it to the worker thread and waking up the consumer to ensure it exits promptly.
0aefe21 [Ewen Cheslack-Postava] Add log4j settings for Copycat.
220e42d [Ewen Cheslack-Postava] Replace Avro serializer with JSON serializer.
1243a7c [Ewen Cheslack-Postava] Merge remote-tracking branch 'origin/trunk' into copycat
5a618c6 [Ewen Cheslack-Postava] Remove offset serializers, instead reusing the existing serializers and removing schema projection support.
e849e10 [Ewen Cheslack-Postava] Remove duplicated TopicPartition implementation.
dec1379 [Ewen Cheslack-Postava] Switch to using new consumer coordinator instead of manually assigning partitions. Remove dependency of copycat-runtime on core.
4a9b4f3 [Ewen Cheslack-Postava] Add some helpful Copycat-specific build and test targets that cover all Copycat packages.
31cd1ca [Ewen Cheslack-Postava] Add CLI tools for Copycat.
e14942c [Ewen Cheslack-Postava] Add Copycat file connector.
0233456 [Ewen Cheslack-Postava] Add copycat-avro and copycat-runtime
11981d2 [Ewen Cheslack-Postava] Add copycat-data and copycat-api
2015-08-15 07:00:51 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':connect:api' )
implementation libs . slf4jApi
2016-01-12 06:16:58 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2022-03-18 00:30:37 +08:00
testImplementation libs . mockitoCore
2015-11-11 06:54:15 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2021-03-05 03:22:22 +08:00
testImplementation project ( ':clients' ) . sourceSets . test . output
2023-09-08 00:24:13 +08:00
testImplementation project ( ':connect:runtime' )
testImplementation project ( ':connect:runtime' ) . sourceSets . test . output
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
2024-07-29 22:43:55 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2015-11-11 06:54:15 +08:00
}
javadoc {
2015-11-30 05:26:32 +08:00
enabled = false
2015-11-11 06:54:15 +08:00
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2015-11-11 06:54:15 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2015-11-11 06:54:15 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2015-11-11 06:54:15 +08:00
exclude ( 'kafka-clients*' )
exclude ( 'connect-*' )
}
into "$buildDir/dependant-libs"
2016-03-18 05:14:12 +08:00
duplicatesStrategy 'exclude'
2015-11-11 06:54:15 +08:00
}
jar {
dependsOn copyDependantLibs
}
}
2016-05-19 07:44:31 +08:00
2018-05-30 12:35:22 +08:00
project ( ':connect:basic-auth-extension' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-basic-auth-extension"
}
2018-05-30 12:35:22 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':connect:api' )
implementation libs . slf4jApi
implementation libs . jaxrsApi
2022-12-05 22:38:40 +08:00
implementation libs . jaxAnnotationApi
2018-05-30 12:35:22 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . bcpkix
2021-09-23 20:08:06 +08:00
testImplementation libs . mockitoCore
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
testImplementation project ( ':clients' ) . sourceSets . test . output
2018-05-30 12:35:22 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
testRuntimeOnly libs . jerseyContainerServlet
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
2018-05-30 12:35:22 +08:00
}
javadoc {
enabled = false
}
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
exclude ( 'kafka-clients*' )
exclude ( 'connect-*' )
}
into "$buildDir/dependant-libs"
duplicatesStrategy 'exclude'
}
jar {
dependsOn copyDependantLibs
}
}
project ( ':connect:mirror' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-mirror"
}
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':connect:api' )
implementation project ( ':connect:runtime' )
implementation project ( ':connect:mirror-client' )
implementation project ( ':clients' )
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
2021-03-05 03:22:22 +08:00
implementation libs . argparse4j
implementation libs . jacksonAnnotations
implementation libs . slf4jApi
2023-02-09 23:50:07 +08:00
implementation libs . jacksonAnnotations
implementation libs . jacksonJaxrsJsonProvider
implementation libs . jerseyContainerServlet
implementation libs . jerseyHk2
implementation libs . jaxbApi // Jersey dependency that was available in the JDK before Java 9
implementation libs . activation // Jersey dependency that was available in the JDK before Java 9
implementation libs . jettyServer
implementation libs . jettyServlet
implementation libs . jettyServlets
implementation libs . jettyClient
implementation libs . swaggerAnnotations
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
2024-06-21 16:43:07 +08:00
testImplementation libs . reload4j
2021-03-05 03:22:22 +08:00
testImplementation libs . mockitoCore
testImplementation project ( ':clients' ) . sourceSets . test . output
testImplementation project ( ':connect:runtime' ) . sourceSets . test . output
testImplementation project ( ':core' )
testImplementation project ( ':core' ) . sourceSets . test . output
2024-04-16 15:28:35 +08:00
testImplementation project ( ':server' )
2024-07-29 22:43:55 +08:00
testImplementation project ( ':server-common' ) . sourceSets . test . output
2021-03-05 03:22:22 +08:00
testRuntimeOnly project ( ':connect:runtime' )
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2021-03-05 03:22:22 +08:00
testRuntimeOnly libs . bcpkix
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
}
javadoc {
enabled = false
}
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
exclude ( 'kafka-clients*' )
exclude ( 'connect-*' )
}
into "$buildDir/dependant-libs"
duplicatesStrategy 'exclude'
}
2023-07-18 23:27:19 +08:00
task genMirrorConnectorConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.connect.mirror.MirrorConnectorConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "mirror_connector_config.html" ) . newOutputStream ( )
}
2022-12-01 01:37:37 +08:00
task genMirrorSourceConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.connect.mirror.MirrorSourceConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "mirror_source_config.html" ) . newOutputStream ( )
}
task genMirrorCheckpointConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.connect.mirror.MirrorCheckpointConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "mirror_checkpoint_config.html" ) . newOutputStream ( )
}
task genMirrorHeartbeatConfigDocs ( type: JavaExec ) {
classpath = sourceSets . main . runtimeClasspath
mainClass = 'org.apache.kafka.connect.mirror.MirrorHeartbeatConfig'
if ( ! generatedDocsDir . exists ( ) ) { generatedDocsDir . mkdirs ( ) }
standardOutput = new File ( generatedDocsDir , "mirror_heartbeat_config.html" ) . newOutputStream ( )
}
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
jar {
dependsOn copyDependantLibs
}
}
project ( ':connect:mirror-client' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-mirror-client"
}
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
dependencies {
2021-03-05 03:22:22 +08:00
implementation project ( ':clients' )
implementation libs . slf4jApi
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
2021-03-05 03:22:22 +08:00
testImplementation libs . junitJupiter
testImplementation project ( ':clients' ) . sourceSets . test . output
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
2024-06-21 16:43:07 +08:00
testRuntimeOnly libs . slf4jReload4j
2024-07-06 06:39:11 +08:00
testRuntimeOnly libs . junitPlatformLanucher
KAFKA-7500: MirrorMaker 2.0 (KIP-382)
Implementation of [KIP-382 "MirrorMaker 2.0"](https://cwiki.apache.org/confluence/display/KAFKA/KIP-382%3A+MirrorMaker+2.0)
Author: Ryanne Dolan <ryannedolan@gmail.com>
Author: Arun Mathew <arunmathew88@gmail.com>
Author: In Park <inpark@cloudera.com>
Author: Andre Price <obsoleted@users.noreply.github.com>
Author: christian.hagel@rio.cloud <christian.hagel@rio.cloud>
Reviewers: Eno Thereska <eno.thereska@gmail.com>, William Hammond <william.t.hammond@gmail.com>, Viktor Somogyi <viktorsomogyi@gmail.com>, Jakub Korzeniowski, Tim Carey-Smith, Kamal Chandraprakash <kamal.chandraprakash@gmail.com>, Arun Mathew, Jeremy-l-ford, vpernin, Oleg Kasian <oleg.kasian@gmail.com>, Mickael Maison <mickael.maison@gmail.com>, Qihong Chen, Sriharsha Chintalapani <sriharsha@apache.org>, Jun Rao <junrao@gmail.com>, Randall Hauch <rhauch@gmail.com>, Manikumar Reddy <manikumar.reddy@gmail.com>, Ismael Juma <ismael@juma.me.uk>
Closes #6295 from ryannedolan/KIP-382
2019-10-07 16:27:54 +08:00
}
javadoc {
enabled = true
}
2018-05-30 12:35:22 +08:00
tasks . create ( name: "copyDependantLibs" , type: Copy ) {
2021-03-05 03:22:22 +08:00
from ( configurations . testRuntimeClasspath ) {
2018-05-30 12:35:22 +08:00
include ( 'slf4j-log4j12*' )
2022-05-11 11:14:21 +08:00
include ( 'reload4j*jar' )
2018-05-30 12:35:22 +08:00
}
2021-03-05 03:22:22 +08:00
from ( configurations . runtimeClasspath ) {
2018-05-30 12:35:22 +08:00
exclude ( 'kafka-clients*' )
exclude ( 'connect-*' )
}
into "$buildDir/dependant-libs"
duplicatesStrategy 'exclude'
}
jar {
dependsOn copyDependantLibs
}
}
2023-08-17 01:30:24 +08:00
project ( ':connect:test-plugins' ) {
2024-05-24 01:15:56 +08:00
base {
archivesName = "connect-test-plugins"
}
2023-08-17 01:30:24 +08:00
dependencies {
api project ( ':connect:api' )
implementation project ( ':server-common' )
implementation libs . slf4jApi
implementation libs . jacksonDatabind
}
}
2021-03-09 22:00:16 +08:00
task aggregatedJavadoc ( type: Javadoc , dependsOn: compileJava ) {
2016-05-19 07:44:31 +08:00
def projectsWithJavadoc = subprojects . findAll { it . javadoc . enabled }
source = projectsWithJavadoc . collect { it . sourceSets . main . allJava }
classpath = files ( projectsWithJavadoc . collect { it . sourceSets . main . compileClasspath } )
includes = projectsWithJavadoc . collectMany { it . javadoc . getIncludes ( ) }
excludes = projectsWithJavadoc . collectMany { it . javadoc . getExcludes ( ) }
}