@InterfaceStability.Unstable public class ConnectorUtils extends Object
Constructor and Description |
---|
ConnectorUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<List<T>> |
groupPartitions(List<T> elements,
int numGroups)
Given a list of elements and a target number of groups, generates list of groups of
elements to match the target number of groups, spreading them evenly among the groups.
|
public static <T> List<List<T>> groupPartitions(List<T> elements, int numGroups)
elements
- list of elements to partitionnumGroups
- the number of output groups to generate.