-
Notifications
You must be signed in to change notification settings - Fork 15.1k
KAFKA-15276: Implement event plumbing for ConsumerRebalanceListener callbacks #14640
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
dajac
merged 85 commits into
apache:trunk
from
kirktrue:KAFKA-15276-partition-reconciliation
Dec 15, 2023
Merged
Changes from all commits
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
81ce457
KAFKA-15276: Implement partition assignment reconciliation
kirktrue 8560860
Reverted previous change to decouple the network thread from the appl…
kirktrue 5d3efaa
Updates to clean up code a bit
kirktrue 5f17c9d
Restoring AbstractCoordinator.createMeter() to protected final
kirktrue d08e180
Update ApplicationEventProcessor.java
kirktrue 0bfd395
Updates to fix threading issues with tests
kirktrue ad19b36
Fixed minor whitespace issue
kirktrue ec01569
Merge remote-tracking branch 'origin/trunk' into KAFKA-15276-partitio…
kirktrue a210acf
Reverted code related to the core reconciliation
kirktrue 48dfc46
Removed more unnecessary changes to align with trunk
kirktrue ffe3093
Reverting more unnecessary changes
kirktrue f7b79e3
Making sure the InternalApplicationEventHandler closed its superclass
kirktrue 9ae3616
Minor documentation changes in EventHandler.add
kirktrue 9e721a5
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue a2a4d73
Updates to try to get back to passing tests
kirktrue 926041e
More updates to get to a clean slate
kirktrue e857104
Clean up #1256
kirktrue 9d372d7
Yet more clean up
kirktrue c044b57
More clean up
kirktrue e828701
More formatting reverting
kirktrue ac4b4e9
More clean up
kirktrue 77e8d8f
More formatting clean up
kirktrue c2e7489
Updates for a first pass at end-to-end logic. Still needs tests creat…
kirktrue 6428ba6
Changed ConsumerRebalanceListenerCallbackName to ConsumerRebalanceLis…
kirktrue 06d4897
Updated AsyncKafkaConsumer.unsubscribe() to block
kirktrue d03c51a
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 993c040
Updates to implement blocking for the consumer to join the group, if …
kirktrue 18bc3aa
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue e449bc2
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 5bdedaa
Update MembershipManagerImpl to print out partitions w/o topic IDs
kirktrue 86adb9a
Updated ConsumerNetworkThread to block for new events (should be spun…
kirktrue 110c7eb
Downgraded logging in MembershipManagerImpl for registering futures t…
kirktrue 3019a9c
Added processBackgroundEvents to AsyncKafkaConsumer
kirktrue 0bb10ee
PlaintextConsumerTest - enabling testMultiConsumerSessionTimeoutOnClo…
kirktrue 925624b
Updates to make disabled tests TODOs
kirktrue 18adb34
Added documentation
kirktrue 7e2cc61
Reverting unrelated changes
kirktrue 22e92c0
More clean up
kirktrue 6238781
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 0f38095
Minor clean up
kirktrue 3babe24
More clean up to remove unnecessary diffs
kirktrue 8ef0f2e
More clean up
kirktrue b2be1e5
More clean up
kirktrue f3b092c
Removed memberIdForLogging() as memberId() is exposed and used for lo…
kirktrue 134bfdb
Reverted the generalization of the EventHandler as it didn't gain much
kirktrue edbffc4
Reverted some unnecessary diffs for BackgroundEventHandler
kirktrue 69f8073
Removed more unnecessary changes
kirktrue 7183d91
More clean up
kirktrue b740e50
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 9645a24
Updates based on feedback
kirktrue 45cf7f5
Clean up
kirktrue 730ee86
Changed a period to a semicolon in a log message
kirktrue 7e00f6d
Minor clean up and comments
kirktrue 8e04846
Added unit tests for ConsumerRebalanceListener callbacks since the in…
kirktrue a6251e3
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 2096fcd
Fixed issue with BackgroundEventHandlerTest that no longer compiled; …
kirktrue 61b95df
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 3f70743
Minor tweak to debug logging for ConsumerRebalanceListener callback m…
kirktrue f1c7502
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 51e3bb1
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue e114d94
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 5009ba8
Moved the client telemetry stuff out of the membership manager and to…
kirktrue 477b5d6
Minor tweaks to the event processor APIs
kirktrue 829af6e
Updates to only pause for AsyncKafkaConsumer.processBackgroundEvents(…
kirktrue c4a97b7
Updates to tests for rebalance callbacks
kirktrue a3dd9e4
Added more test cases to MembershipManagerImplTest for failing callbacks
kirktrue 1c7e0ad
Updates to make creating sets of TopicPartitions and TopicIdPartition…
kirktrue 482fa55
Added missing mock method to fix testListenerCallbacksBasic
kirktrue f9f3a46
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 251fdc9
Added MembershipManagerImplTest testListenerCallbacksThrowsErrorOnPar…
kirktrue 64bf9de
Updates to revert unncessesary changes
kirktrue 47bdc7c
More clean up to revert and streamline PR
kirktrue 51ae424
More clean up
kirktrue f554148
Minor formatting change
kirktrue bc4e2aa
Added a parameterized unit test for callbacks to AsyncKafkaConsumerTest
kirktrue 5c130eb
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue e57d39d
Re-enabled MembershipManagerImplTest.testListenerCallbacksThrowsError…
kirktrue c52b795
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue 9211f64
Update set of PlaintextConsumerTest's disabled/enabled integration te…
kirktrue f2de384
Enable another previously disable test in PlaintextConsumerTest
kirktrue de78235
Enabled testCoordinatorFailover for consumer group protocol now that …
kirktrue a184aa3
TODO-ified comments for PlaintextConsumerTest for consumer interceptors
kirktrue 04f9875
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue fff4440
Fix compilation error in MembershipManagerImplTest post-sync of fork
kirktrue 91953e1
Merge branch 'trunk' into KAFKA-15276-partition-reconciliation
kirktrue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
240 changes: 216 additions & 24 deletions
240
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
46 changes: 46 additions & 0 deletions
46
...java/org/apache/kafka/clients/consumer/internals/ConsumerRebalanceListenerMethodName.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| /* | ||
| * Licensed to the Apache Software Foundation (ASF) under one or more | ||
| * contributor license agreements. See the NOTICE file distributed with | ||
| * this work for additional information regarding copyright ownership. | ||
| * The ASF licenses this file to You under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with | ||
| * the License. You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.apache.kafka.clients.consumer.internals; | ||
|
|
||
| import org.apache.kafka.clients.consumer.ConsumerRebalanceListener; | ||
|
|
||
| /** | ||
| * This class just provides a static name for the methods in the {@link ConsumerRebalanceListener} interface | ||
| * for a bit more compile time assurance. | ||
| */ | ||
| public enum ConsumerRebalanceListenerMethodName { | ||
|
|
||
| ON_PARTITIONS_REVOKED("onPartitionsRevoked"), | ||
| ON_PARTITIONS_ASSIGNED("onPartitionsAssigned"), | ||
| ON_PARTITIONS_LOST("onPartitionsLost"); | ||
|
|
||
| private final String fullyQualifiedMethodName; | ||
|
|
||
| ConsumerRebalanceListenerMethodName(String methodName) { | ||
| this.fullyQualifiedMethodName = String.format("%s.%s", ConsumerRebalanceListener.class.getSimpleName(), methodName); | ||
| } | ||
|
|
||
| /** | ||
| * Provides the fully-qualified method name, e.g. {@code ConsumerRebalanceListener.onPartitionsRevoked}. This | ||
| * is used for log messages. | ||
| * | ||
| * @return Fully-qualified method name | ||
| */ | ||
| public String fullyQualifiedMethodName() { | ||
| return fullyQualifiedMethodName; | ||
| } | ||
| } |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.