lucasbru opened a new pull request, #21436: URL: https://github.com/apache/kafka/pull/21436
## Summary This refactoring simplifies the streams group coordinator by replacing the `ConfiguredTopology`, `ConfiguredSubtopology`, and `ConfiguredInternalTopic` classes with a simpler `TopologyValidationResult` record. `TopologyValidationResult` is a new record that captures the validation state of a topology, including the topology epoch, internal topics to be created, any configuration exceptions, and an optional `TopologyMetadata` when the topology is ready. `TopologyMetadata` is now a class that pre-computes partition counts from the metadata image and `StreamsTopology`. This enables O(1) lookups for max partitions per subtopology instead of recomputing on each access. `InternalTopicManager.configureTopics` now returns `TopologyValidationResult` directly instead of `ConfiguredTopology`. The topology metadata is only created when all required topics exist. `StreamsGroup` stores `TopologyValidationResult` instead of `ConfiguredTopology`, with renamed accessor methods. `TargetAssignmentBuilder` now accepts `TopologyValidationResult` and extracts `TopologyMetadata` from it. `EndpointToPartitionsManager` now takes `StreamsTopology` directly as a parameter instead of fetching it from `StreamsGroup`, which fixes a timing issue during heartbeat processing. The three `Configured*` classes and their tests are deleted as they are no longer needed. ## Test plan - [x] Unit tests pass: `TopologyValidationResultTest`, `TopologyMetadataTest`, `InternalTopicManagerTest`, `TargetAssignmentBuilderTest`, `EndpointToPartitionsManagerTest`, `StreamsGroupTest` - [x] All `GroupMetadataManagerTest` tests pass (410+ tests) - [x] All streams group coordinator tests pass - [x] Checkstyle and spotless checks pass - [x] Integration tests pass: `SmokeTestDriverIntegrationTest`, `InternalTopicIntegrationTest` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
