Skip to content

KAFKA-15853: Move configDef out of core#16116

Merged
mimaison merged 16 commits intoapache:trunkfrom
OmniaGM:KAFKA-15853-move-configDef-out
Jun 14, 2024
Merged

KAFKA-15853: Move configDef out of core#16116
mimaison merged 16 commits intoapache:trunkfrom
OmniaGM:KAFKA-15853-move-configDef-out

Conversation

@OmniaGM
Copy link
Copy Markdown
Contributor

@OmniaGM OmniaGM commented May 28, 2024

Moving configDef from core into server::KafkaConfig, keeping the old reference from core::KafkaConfig for the time being to avoid the confusion when we have need to import server::KafkaConfig and core::KafkaConfig.

The following PRs will move the rest of core::KafkaConfig`

This will reduce conflicts while finishing the last part of moving KafkaConfig out of core

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

@chia7712
Copy link
Copy Markdown
Member

@OmniaGM Could you please fix the conflicts

@OmniaGM OmniaGM force-pushed the KAFKA-15853-move-configDef-out branch from 51c53bd to 3e580ce Compare May 29, 2024 22:22
@OmniaGM OmniaGM force-pushed the KAFKA-15853-move-configDef-out branch from 3e580ce to 3c70661 Compare May 29, 2024 22:27
@OmniaGM OmniaGM force-pushed the KAFKA-15853-move-configDef-out branch from 753ecbb to 1a765a5 Compare May 29, 2024 22:34
@chia7712
Copy link
Copy Markdown
Member

@OmniaGM Please fix the conflicts, thanks!

@chia7712
Copy link
Copy Markdown
Member

@OmniaGM Sorry that please fix the conflicts again :_

@OmniaGM OmniaGM force-pushed the KAFKA-15853-move-configDef-out branch from 72c3776 to 9aef77c Compare June 3, 2024 08:46
@nizhikov
Copy link
Copy Markdown
Contributor

nizhikov commented Jun 4, 2024

There are more conflicts now.

@OmniaGM Can you, please, fix it.

@OmniaGM
Copy link
Copy Markdown
Contributor Author

OmniaGM commented Jun 4, 2024

Fixed let's hope this is the last one :)

@chia7712
Copy link
Copy Markdown
Member

chia7712 commented Jun 4, 2024

Fixed let's hope this is the last one :)

if it can go conflicted, it will :)

Comment thread server/src/main/java/org/apache/kafka/server/config/KafkaConfig.java Outdated
Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmniaGM thanks for updated PR!

Comment thread server/src/main/java/org/apache/kafka/server/config/KafkaConfig.java Outdated
Comment thread server/src/main/java/org/apache/kafka/server/config/KafkaConfig.java Outdated
import static org.apache.kafka.common.config.ConfigDef.Type.SHORT;
import static org.apache.kafka.common.config.ConfigDef.Type.STRING;

public class KafkaConfig {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add comments to explain why we have "two" KafkaConfig in code base? That can avoid confusion when someone try to add something to KafkaConfig in the future.

- Make org.apache.kafka.server.config.KafkaConfig abstract so others can start move their methods there
Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@OmniaGM thanks for updated PR. could you please fix build error?

[2024-06-10T15:13:31.280Z] > Task :core:compileScala

[2024-06-10T15:13:31.280Z] [Error] /home/jenkins/jenkins-agent/workspace/Kafka_kafka-pr_PR-16116/core/src/main/scala/kafka/server/KafkaConfig.scala:27:40: Unused import

* Any code depends on kafka.server.KafkaConfig will keep for using kafka.server.KafkaConfig for the time being until we move it out of core
* For more details check KAFKA-15853
*/
abstract public class KafkaConfig extends AbstractConfig {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems public abstract class is used more frequent than abstract public class. Maybe we can align it?

@chia7712
Copy link
Copy Markdown
Member

@OmniaGM Sorry that conflicts happen again :_

@OmniaGM
Copy link
Copy Markdown
Contributor Author

OmniaGM commented Jun 13, 2024

@OmniaGM Sorry that conflicts happen again :_

Done let's hope this is the final one :D

Copy link
Copy Markdown
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
I left a couple of suggestions but these can be addressed in one of the follow up PRs you have for KafkaConfig

Comment thread server/src/main/java/org/apache/kafka/server/config/KafkaConfig.java Outdated
Copy link
Copy Markdown
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
I left a couple of suggestions but these can be addressed in one of the follow up PRs you have for KafkaConfig

Comment thread server/src/main/java/org/apache/kafka/server/config/KafkaConfig.java Outdated
@OmniaGM
Copy link
Copy Markdown
Contributor Author

OmniaGM commented Jun 13, 2024

I have renamed the class to AbstractKafkaConfig to get ripped of NM_SAME_SIMPLE_NAME_AS_SUPERCLASS error from spotbug

@OmniaGM
Copy link
Copy Markdown
Contributor Author

OmniaGM commented Jun 13, 2024

That is a intermediate state, right? I assume there will be specific config calss for different component (such as RemoteLogManagerConfig and QuorumConfig). server::KafkaConfig will be either nonexistent or small class (maybe do check for all configs or run once in starting)

Looking into this again. I think we can squeeze part of this vision in as it will reduce conflict with this work going forward specially with the ongoing work for shared groups and new coordinator which I want to avoid as it is hardest to fix. I published this in 88122cb @chia7712 and @mimaison please have a look again. I would really appreciate if we can merge this pr as it is getting painful to keep up with the conflicts :)

For future improvements we can see the possibility of moving getters/ and validations logic as well into these specific config classes but not in the scope of KAFKA-15853.

@mimaison
Copy link
Copy Markdown
Member

@OmniaGM spotlessJavaCheck is failing for transaction-coordinator and server-common: https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka-pr/detail/PR-16116/17/pipeline

@OmniaGM OmniaGM force-pushed the KAFKA-15853-move-configDef-out branch from 7c173f7 to 5389335 Compare June 13, 2024 20:55
@chia7712
Copy link
Copy Markdown
Member

I think we can squeeze part of this vision in as it will reduce conflict with this work going forward specially with the ongoing work for shared groups and new coordinator which I want to avoid as it is hardest to fix

I love this code style

please have a look again. I would really appreciate if we can merge this pr as it is getting painful to keep up with the conflicts :)

I've set the alarm for this PR :)

Copy link
Copy Markdown
Member

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chia7712
Copy link
Copy Markdown
Member

wait a minute. it seems there are failed tests related to this PR

https://ci-builds.apache.org/blue/organizations/jenkins/Kafka%2Fkafka-pr/detail/PR-16116/19/tests

Copy link
Copy Markdown
Member

@mimaison mimaison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a weird state but I understand this is temporary and you have follow up PRs that should tidy things up.
LGTM, let's get this merged as it's a pain to keep in sync

@mimaison
Copy link
Copy Markdown
Member

None of the test failures are related, merging to trunk

@mimaison mimaison merged commit e99da24 into apache:trunk Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants