use of org.apache.samza.container.grouper.task.GroupByContainerCount in project samza by apache.
the class TestApplicationMasterRestClient method generateContainers.
private HashMap<String, ContainerModel> generateContainers() {
Set<TaskModel> taskModels = ImmutableSet.of(new TaskModel(new TaskName("task1"), ImmutableSet.of(new SystemStreamPartition(new SystemStream("system1", "stream1"), new Partition(0))), new Partition(0)), new TaskModel(new TaskName("task2"), ImmutableSet.of(new SystemStreamPartition(new SystemStream("system1", "stream1"), new Partition(1))), new Partition(1)));
GroupByContainerCount grouper = new GroupByContainerCount(2);
Set<ContainerModel> containerModels = grouper.group(taskModels);
HashMap<String, ContainerModel> containers = new HashMap<>();
for (ContainerModel containerModel : containerModels) {
containers.put(containerModel.getId(), containerModel);
}
return containers;
}
Aggregations