Skip to content

KAFKA-14895: [2/N] Move AddPartitionsToTxnManager files to java #19933

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

Merged
merged 3 commits into from
Jun 17, 2025

Conversation

brandboat
Copy link
Member

@brandboat brandboat commented Jun 9, 2025

Move AddPartitionsToTxnManagerTest to java

Reviewers: Chia-Ping Tsai chia7712@gmail.com

@github-actions github-actions bot added the core Kafka Broker label Jun 9, 2025
@brandboat
Copy link
Member Author

This is the final piece of KAFKA-14895

@brandboat
Copy link
Member Author

AC, gentle ping @chia7712, @jolshan, could you please take a look when you are available? Thank you!

@jolshan jolshan self-requested a review June 10, 2025 22:14
.setName(topic)
.setPartitions(tps.stream().map(TopicPartition::partition).collect(Collectors.toList())));
});
topicPartitions.stream().collect(Collectors.groupingBy(TopicPartition::topic)).forEach((topic, tps) ->
Copy link
Member

Choose a reason for hiding this comment

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

Please consider leveraging the topic name index to avoid regrouping. for example:

            topicPartitions.forEach(tp -> {
                var r = topicCollection.find(tp.topic());
                if (r == null) {
                    r = new AddPartitionsToTxnTopic().setName(tp.topic());
                    topicCollection.add(r);
                }
                r.partitions().add(tp.partition());
            });

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated, thanks!

Copy link
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

@jolshan Please feel free to leave any comments. We shall address them in the follow-up.

@chia7712 chia7712 merged commit 86cd5d5 into apache:trunk Jun 17, 2025
24 checks passed
@brandboat brandboat deleted the KAFKA-14895-2 branch June 17, 2025 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants