KAFKA-20684 [9/N]: Deprecate ConsumerRebalanceListener for removal - #23115
Open
adikou wants to merge 12 commits into
Open
KAFKA-20684 [9/N]: Deprecate ConsumerRebalanceListener for removal#23115adikou wants to merge 12 commits into
adikou wants to merge 12 commits into
Conversation
…oads Drops the three subscribe(X, Optional<ConsumerRebalanceListener>) overloads and the listener argument at all 52 call sites, all in clients/src/test.
Switches the two example listeners to RebalanceListener and registers them via setRebalanceListener. Comments now point at the RebalanceConsumer parameter, which makes the operations they describe actually reachable. No behaviour change.
Switches ConsumerPerfRebListener, VerifiableConsumer and TransactionalMessageCopier to RebalanceListener and registers them via setRebalanceListener.
WorkerSinkTask's HandleRebalance becomes a RebalanceListener, registered via setRebalanceListener. Tests capture the listener from setRebalanceListener rather than from subscribe. Callback bodies keep using the enclosing consumer field.
StreamsRebalanceListener implements RebalanceListener and StreamThread registers it via setRebalanceListener. RegexSourceIntegrationTest now intercepts by overriding setRebalanceListener, since that is what StreamThread calls. StreamThreadTest's subscribe verifications are split so they keep asserting something real.
…istener Migrates rather than suppressing: -Xfatal-warnings applies to compileTestScala, and a @nowarn that suppresses nothing is itself fatal.
Widens the private subscribeInternal helpers to RebalanceListener and retargets internal javadoc, including StickyAssignor's worked examples. Log strings now say RebalanceListener.onPartitionsX; no assertions depend on them.
Migrates the shared TestConsumerReassignmentListener fixture and its call sites. Tests that exist to cover the deprecated bridge or the deprecated subscribe overloads are deliberately left on ConsumerRebalanceListener.
Marks the interface and the three subscribe(..., ConsumerRebalanceListener) overloads @deprecated(since = "4.4", forRemoval = true), and adds @SuppressWarnings("removal") to the declarations that must retain them. Must land after the migration commits: -Werror covers every main source set and -Xfatal-warnings covers compileTestScala.
Contributor
Author
|
Waiting on 1-8/N merging in which case this PR would only be addition of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a
@Deprecatedannotation on the now deprecated and uses removed (subscribe* methods on Consumer + ConsumerRebalanceListener) with forRemoval=true so future compilation would fail on the project, and log a loud warning on any clients using it.