-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-12758 Added server-common module to have server side common classes.
#10638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -779,6 +779,7 @@ project(':core') { | |
| api project(':clients') | ||
| api libs.scalaLibrary | ||
|
|
||
| implementation project(':server-common') | ||
| implementation project(':metadata') | ||
| implementation project(':raft') | ||
| implementation project(':storage') | ||
|
|
@@ -1070,6 +1071,7 @@ project(':metadata') { | |
| archivesBaseName = "kafka-metadata" | ||
|
|
||
| dependencies { | ||
| implementation project(':server-common') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not directly related to this PR. Do you know why we only include the storage module in releaseTarGz target, but not other server side modules?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. It looks like these are already copied as part of |
||
| implementation project(':clients') | ||
| implementation libs.jacksonDatabind | ||
| implementation libs.jacksonJDK8Datatypes | ||
|
|
@@ -1267,11 +1269,13 @@ project(':raft') { | |
| archivesBaseName = "kafka-raft" | ||
|
|
||
| dependencies { | ||
| implementation project(':server-common') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed since server-common is included in metadata?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pl see the earlier comment. |
||
| implementation project(':clients') | ||
| implementation project(':metadata') | ||
| implementation libs.slf4jApi | ||
| implementation libs.jacksonDatabind | ||
|
|
||
| testImplementation project(':server-common') | ||
| testImplementation project(':clients') | ||
| testImplementation project(':clients').sourceSets.test.output | ||
| testImplementation libs.junitJupiter | ||
|
|
@@ -1345,6 +1349,62 @@ project(':raft') { | |
| } | ||
| } | ||
|
|
||
| project(':server-common') { | ||
| archivesBaseName = "kafka-server-common" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to move the classes in storage-api here? It helps reduce one module.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I plan to do that in another PR. I have not yet decided whether to have a separate sub module like
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a good question and worth thinking about a bit more. I agree we can do it in a separate PR. I think the main thing to consider is how we differentiate between public classes exposed to users and common classes to be used by the kafka server modules.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Created https://issues.apache.org/jira/browse/KAFKA-12757 to discuss more on this. |
||
|
|
||
| dependencies { | ||
| api project(':clients') | ||
| implementation libs.slf4jApi | ||
|
|
||
| testImplementation project(':clients') | ||
| testImplementation project(':clients').sourceSets.test.output | ||
| testImplementation libs.junitJupiter | ||
| testImplementation libs.mockitoCore | ||
|
|
||
| testRuntimeOnly libs.slf4jlog4j | ||
| } | ||
|
|
||
| task createVersionFile(dependsOn: determineCommitId) { | ||
| ext.receiptFile = file("$buildDir/kafka/$buildVersionFileName") | ||
| outputs.file receiptFile | ||
| outputs.upToDateWhen { false } | ||
| 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 { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we only going to allow Java sources in this new module? (I think that's probably a good idea) |
||
| srcDirs = ["src/main/java"] | ||
| } | ||
| } | ||
| test { | ||
| java { | ||
| srcDirs = ["src/test/java"] | ||
| } | ||
| } | ||
| } | ||
|
|
||
| jar { | ||
| dependsOn createVersionFile | ||
| from("$buildDir") { | ||
| include "kafka/$buildVersionFileName" | ||
| } | ||
| } | ||
|
|
||
| clean.doFirst { | ||
| delete "$buildDir/kafka/" | ||
| } | ||
| } | ||
|
|
||
| project(':storage:api') { | ||
| archivesBaseName = "kafka-storage-api" | ||
|
|
||
|
|
@@ -1410,9 +1470,8 @@ project(':storage') { | |
|
|
||
| dependencies { | ||
| implementation project(':storage:api') | ||
| implementation project(':server-common') | ||
| implementation project(':clients') | ||
| implementation project(':metadata') | ||
| implementation project(':raft') | ||
| implementation libs.slf4jApi | ||
| implementation libs.jacksonDatabind | ||
|
|
||
|
|
@@ -1585,6 +1644,7 @@ project(':shell') { | |
| implementation libs.jacksonJDK8Datatypes | ||
| implementation libs.jline | ||
| implementation libs.slf4jApi | ||
| implementation project(':server-common') | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this needed since core already depends on server-common?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, this is needed because I am not sure whether we really have usages for
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. core should generally not expose anything with api since core doesn't expose any public api. |
||
| implementation project(':clients') | ||
| implementation project(':core') | ||
| implementation project(':log4j-appender') | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that needed since server-common is included in metadata/storage already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it is needed as
server-commonis only compile/runtime dependency ofraftandmetadata. But it is not a transitive dependency.