KAFKA-20790: Promote streams assignor API to public module#22788
Open
gabriellefu wants to merge 4 commits into
Open
KAFKA-20790: Promote streams assignor API to public module#22788gabriellefu wants to merge 4 commits into
gabriellefu wants to merge 4 commits into
Conversation
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.
Changes
New public API package
org.apache.kafka.coordinator.group.api.assignor.streams(ingroup-coordinator-api), all annotated with@InterfaceAudience.Publicand@InterfaceStability.Evolving.TaskAssignor,GroupAssignment,GroupSpec,MemberAssignment,MemberSubscription,TaskId,TopologyDescriber, andTaskAssignorExceptionfrom the internalstreams.assignorpackage into the new public package.package-info.java.GroupSpecnow exposesmemberIds(),memberSubscription(id),memberAssignmentState(id), andconfigs()instead ofmembers()andassignmentConfigs().MemberSubscriptionis now a thin interface containinginstanceId,rackId,processId, andclientTags.MemberAssignmentStatewithactiveTasks,standbyTasks,warmupTasks,taskOffsets, andtaskEndOffsetsto represent a member’s current assignment state, split out from the previous larger member spec.MemberAssignmentis now an interface exposing onlyactiveTasks()andstandbyTasks(). Warm-up tasks are no longer produced by the assignor and are now determined during reconciliation.Internal implementations
These remain in
group-coordinator, under thestreams.assignorpackage.MemberSubscriptionAndAssignmentImpl, which implements bothMemberSubscriptionandMemberAssignmentState.MemberAssignmentImpl, which implementsMemberAssignment.AssignmentMemberSpecrecord.GroupSpecImplto back the newGroupSpecinterface.StickyTaskAssignor,MockAssignor) andTargetAssignmentBuilderto use the new interfaces.TargetAssignmentBuildernow always emits empty warm-up tasks in the resulting target assignment.GroupMetadataManager,TopologyMetadata,MemberTaskOffsets, andProcessState.Tests and benchmarks
TargetAssignmentBuilderTest,GroupMetadataManagerTest, and the JMH benchmarks (StreamsAssignorBenchmarkUtils,StreamsStickyAssignorBenchmark) to use the new API.GroupSpecImplTestto exercise the new accessors.testAssignmentHasNotChanged,testAssignmentSwapped,testPartialAssignmentUpdate) toACTIVEandSTANDBY, since warm-up tasks can no longer appear in assignor output.