Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Current state: Under Discussion

Discussion thread: here [Change the link from the KIP proposal email archive to your own email thread]

JIRA: here

Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).


Motivation

Currently, ConnectorUtils in Kafka Connect API provides functionality for assigning continuous elements in groups. However, there are scenarios where this approach falls short, particularly when a more balanced distribution of elements across groups is desired. In such cases, a round-robin assignment strategy can offer a more equitable allocation of elements.

...

public static <T> List<List<T>> groupElementsRoundRobin(List<T> elements, int numGroups)

Proposed Changes

We propose extending Extend ConnectorUtils with a round-robin assignment strategy to facilitate more balanced distribution of continuous elements across different groups. This strategy would evenly distribute elements among the available groups, ensuring a more equitable allocation and minimizing potential imbalances.

...

This proposal does not introduce any compatibility issues or deprecations. Existing functionality in ConnectorUtils will remain unchanged, and the round-robin assignment strategy will be introduced as an additional option.

Test Plan

Unit No other classes depend on this util. The change only adds a new static method and won't break existing method. So, unit tests are enough to cover all cases.

...

Define a Strategy interface, then user can pass different strategy implementation. This solution is incompatible with current ConnectorUtils. Current strategy and round-robin strategy are enough for most scenarios, no other strategies are needed, so there is no need to make extension on strategy.