dajac opened a new pull request, #23801:
URL: https://github.com/apache/kafka/pull/23801

   Depends on #23733: only the last commit belongs to this PR.
   
   The `IndexedGroup` constructor reads the subscriptions with
   `SubscriptionReader` and `CohortsBySubscription`, then renumbers their
   topic indices and cohort subscriptions in place, after taking them
   through a field access and the `subscriptions()` getter. The helpers
   hand over structures that are invalid afterwards, without their API
   showing it.
   
   This patch moves the read phase into `IndexedGroup.Builder`, which owns
   all its state and renumbers it in place in `build()`, and makes
   `IndexedGroup` an immutable holder of the finished data. The operations
   and the results do not change.
   
   Changes:
   - Add `IndexedGroup.Builder`, which merges `SubscriptionReader` and
     `CohortsBySubscription` and computes the members of every cohort,
     the subscriber counts and the cohorts of every topic. `build()` can
     be called once.
   - `IndexedGroup` takes the finished data in its constructor and keeps
     its accessors.
   - `IndexedGroupTest` tests the cohorts with the same hash through a
     group spec, and tests that a second `build()` throws.
   - The tests build their groups with `IndexedGroup.Builder`.
   


-- 
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]

Reply via email to