Skip to content

MINOR: Cleanup JMH-Benchmarks Module #19791

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

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

Conversation

sjhajharia
Copy link
Contributor

@sjhajharia sjhajharia commented May 23, 2025

Now that Kafka supports Java 17, this PR makes some changes in
jmh-benchmarks module. The changes mostly include:

  • Collections.emptyList(), Collections.singletonList() and
    Arrays.asList() are replaced with List.of()
  • Collections.emptyMap() and Collections.singletonMap() are replaced
    with Map.of()
  • Collections.singleton() is replaced with Set.of()

@github-actions github-actions bot added triage PRs from the community performance labels May 23, 2025
@sjhajharia sjhajharia changed the title Cleanup JMH-Benchmarks Module MINOR: Cleanup JMH-Benchmarks Module May 23, 2025
@Yunyung
Copy link
Collaborator

Yunyung commented May 23, 2025

Thanks for the PR. Could you also do this cleanup?
Collections.unmodifiableMap -> Map.copyOf

@sjhajharia
Copy link
Contributor Author

Thanks @Yunyung for the review. I have addressed the comment.
PTAL when possible!

Copy link
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

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

Thanks @sjhajharia for this patch, left a comment

@@ -189,7 +187,7 @@ private Optional<String> rackId(int memberIndex) {
private static Map<Integer, Set<String>> mkMapOfPartitionRacks(int numPartitions) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this mkMapOfPartitionRacks method is unused, we should remove it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

mkMapOfPartitionRacks will be removed all at once in #19797, so it's fine here.

@github-actions github-actions bot removed the triage PRs from the community label May 25, 2025
@m1a2st
Copy link
Collaborator

m1a2st commented May 26, 2025

Please resolve the conflict, thanks

@sjhajharia
Copy link
Contributor Author

Hey @m1a2st
I have updated the PR

Copy link
Collaborator

@m1a2st m1a2st left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM

@sjhajharia
Copy link
Contributor Author

cc: @frankvicky

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.

4 participants