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: Remove deprecated constructors from Connect's Kafka*BackingStore classes #15865

Merged
merged 2 commits into from
May 17, 2024

Conversation

yashmayya
Copy link
Contributor

@yashmayya yashmayya requested a review from chia7712 May 5, 2024 13:36
@yashmayya
Copy link
Contributor Author

Context - #13434 (comment)

Copy link
Contributor

@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.

@yashmayya thanks for this patch. LGTM. just one small comment

@@ -160,7 +155,7 @@ public KafkaStatusBackingStore(Time time, Converter converter, Supplier<TopicAdm

// visible for testing
KafkaStatusBackingStore(Time time, Converter converter, String statusTopic, KafkaBasedLog<String, byte[]> kafkaLog) {
this(time, converter);
this(time, converter, null, "connect-distributed-");
Copy link
Contributor

Choose a reason for hiding this comment

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

This constructor is used by testing. It set topicAdminSupplier to null, so we have to handle the "null" topicAdminSupplier just for testing. That is a bit awkward to me. Could we require those test cases pass a topicAdminSupplier instead of null? Those tests can pass a fake topicAdminSupplier to constructor if they expect topicAdminSupplier should not be called in testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a good point. I think this and the "ownTopicAdmin" are cruft left over from earlier refactors and are definitely no longer used anywhere in Connect itself (or MM2). Since these aren't part of Connect's public API, I think we should be fine with removing them.

@chia7712
Copy link
Contributor

@yashmayya any update? I'm ok to merge it and open follow-up to address remaining comments.

@yashmayya yashmayya force-pushed the remove-deprecated-constructors branch from 2631cc6 to 96c9f66 Compare May 16, 2024 11:00
…wnTopicAdmin' cruft from Kafka*BackingStore classes
@yashmayya yashmayya force-pushed the remove-deprecated-constructors branch from 96c9f66 to 73d82d0 Compare May 16, 2024 11:00
Copy link
Contributor Author

@yashmayya yashmayya left a comment

Choose a reason for hiding this comment

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

Apologies for the delay, and thanks for following up @chia7712.

@@ -160,7 +155,7 @@ public KafkaStatusBackingStore(Time time, Converter converter, Supplier<TopicAdm

// visible for testing
KafkaStatusBackingStore(Time time, Converter converter, String statusTopic, KafkaBasedLog<String, byte[]> kafkaLog) {
this(time, converter);
this(time, converter, null, "connect-distributed-");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's a good point. I think this and the "ownTopicAdmin" are cruft left over from earlier refactors and are definitely no longer used anywhere in Connect itself (or MM2). Since these aren't part of Connect's public API, I think we should be fine with removing them.

Copy link
Contributor

@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 chia7712 merged commit 6aac009 into apache:trunk May 17, 2024
1 check failed
rreddy-22 pushed a commit to rreddy-22/kafka-rreddy that referenced this pull request May 24, 2024
…re classes (apache#15865)

- These constructors were deprecated over 3 years ago in KAFKA-10021: Changed Kafka backing stores to use shared admin client to get end offsets and create topics apache#9780.
- While these classes are not a part of Connect's public API, deprecation was still introduced instead of outright removal because they are useful utility classes that might've been used outside of Connect.
- The KafkaOffsetBackingStore's deprecated constructor was removed in KAFKA-14785: Connect offset read REST API apache#13434.
- This patch removes the deprecated constructors for KafkaConfigBackingStore and KafkaStatusBackingStore.

Reviewers: Chia-Ping Tsai <chia7712@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants