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

MINOR: Fix Some Exceptions in MetaPropertiesEnsemble and MetadataQuorumCommand #18957

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

nihyxx
Copy link

@nihyxx nihyxx commented Feb 18, 2025

What

This is a minor PR to remove some unneeded exceptions and make Exceptions more specific.

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 tools kraft small Small PRs labels Feb 18, 2025
Copy link
Member

@jsancio jsancio left a comment

Choose a reason for hiding this comment

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

Thanks for the improvements @nihyxx. Can you add a description to the PR?

Comment on lines 269 to 275
"\nLeaderId: " + quorumInfo.leaderId() +
"\nLeaderEpoch: " + quorumInfo.leaderEpoch() +
"\nHighWatermark: " + quorumInfo.highWatermark() +
"\nMaxFollowerLag: " + maxFollowerLag +
"\nMaxFollowerLagTimeMs: " + maxFollowerLagTimeMs +
"\nCurrentVoters: " + printVoterState(quorumInfo) +
"\nCurrentObservers: " + printObserverState(quorumInfo)
"\nLeaderId: " + quorumInfo.leaderId() +
"\nLeaderEpoch: " + quorumInfo.leaderEpoch() +
"\nHighWatermark: " + quorumInfo.highWatermark() +
"\nMaxFollowerLag: " + maxFollowerLag +
"\nMaxFollowerLagTimeMs: " + maxFollowerLagTimeMs +
"\nCurrentVoters: " + printVoterState(quorumInfo) +
"\nCurrentObservers: " + printObserverState(quorumInfo)
Copy link
Member

Choose a reason for hiding this comment

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

This indentation doesn't look correct. We indent Java code using 4 spaces.

@@ -404,16 +404,16 @@ static Set<RaftVoterEndpoint> getControllerAdvertisedListeners(
}
LinkedHashSet<RaftVoterEndpoint> results = new LinkedHashSet<>();
for (String listenerName : props.getProperty(
KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")) {
Copy link
Member

Choose a reason for hiding this comment

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

How about this indentation and formatting so that the for loop statement block is clearly separated from the for loop iterable.

        for (String listenerName : props.getProperty(
            KRaftConfigs.CONTROLLER_LISTENER_NAMES_CONFIG).split(",")
        ) {

Comment on lines 415 to 416
endpoint.host() == null ? "localhost" : endpoint.host(),
endpoint.port()));
Copy link
Member

Choose a reason for hiding this comment

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

How about this formatting?

            results.add(
                new RaftVoterEndpoint(
                    endpoint.listenerName().get(),
                    endpoint.host() == null ? "localhost" : endpoint.host(),
                    endpoint.port()
                )
            );

@jsancio jsancio self-assigned this Feb 21, 2025
@github-actions github-actions bot removed the triage PRs from the community label Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants