Skip to content
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

KAFKA-18553: Update javadoc and comments of ConfigType #18567

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from

Conversation

frankvicky
Copy link
Contributor

JIRA: KAFKA-18553
The description of this class is outdated.

Committer Checklist (excluded from commit message)

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

@github-actions github-actions bot added triage PRs from the community core Kafka Broker small Small PRs labels Jan 16, 2025
@@ -31,6 +31,5 @@ public class ConfigType {
public static final String CLIENT_METRICS = "client-metrics";
public static final String GROUP = "groups";

// Do not include ClientMetrics and Groups in `all` as they are not supported on ZK.
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, does this mean we should change ALL? cc @apoorvmittal10 @AndrewJSchofield

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we can eliminate ALL since it's exclusively used by ConfigCommand after the removal of ZooKeeper code

Copy link
Member

Choose a reason for hiding this comment

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

Why would we remove it? It seems like a useful concept and better placed here than in the command itself.

Copy link
Member

Choose a reason for hiding this comment

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

I would, in fact, avoid the need for ConfigCommand to do its own definition of the config types the system supports - commands should ideally not have any such logic.

Copy link
Member

Choose a reason for hiding this comment

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

ConfigCommand use ALL to do pre-check before calling related APIs. Hence, it should be fine to remove the ALL as ConfigCommand eventually throw exception if user-defined string is not a allowed type.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

+1 to replace with current implementation with enum.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we agree to convert this class to an enum, I suggest we handle this after #18585 is merged, since ConfigType is widely used by AdminZkClient.

Copy link
Member

Choose a reason for hiding this comment

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

Making it an enum is fine, but can also be done separately. We can file that as a JIRA if we want to decouple from this PR. The reason why I raised the issue is that by removing the comment that was there, we had lost track of the reason for the unusual behavior (which is no longer needed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see.
Indeed the definition of All has been change after removing zk.
I will file a ticket for converting to enum issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@github-actions github-actions bot removed the triage PRs from the community label Jan 17, 2025
@frankvicky frankvicky force-pushed the KAFKA-18553 branch 3 times, most recently from 51eaeef to a0bc2b8 Compare January 19, 2025 01:22
@@ -31,6 +31,5 @@ public class ConfigType {
public static final String CLIENT_METRICS = "client-metrics";
public static final String GROUP = "groups";

// Do not include ClientMetrics and Groups in `all` as they are not supported on ZK.
public static final List<String> ALL = Arrays.asList(TOPIC, CLIENT, USER, BROKER, IP);
public static final List<String> ALL = Arrays.asList(TOPIC, CLIENT, USER, BROKER, IP, CLIENT_METRICS, GROUP);
Copy link
Member

Choose a reason for hiding this comment

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

Can we use List.of()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

JIRA: KAFKA-18553
The description of this class is outdated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-approved core Kafka Broker small Small PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants