use of io.atomix.utils.concurrent.ThreadPoolContextFactory in project atomix by atomix.
the class PrimaryBackupPartitionGroup method open.
@Override
public CompletableFuture<ManagedPartitionGroup> open(PartitionManagementService managementService) {
threadFactory = new ThreadPoolContextFactory("atomix-" + name() + "-%d", Runtime.getRuntime().availableProcessors() * 2, LOGGER);
List<CompletableFuture<Partition>> futures = partitions.values().stream().map(p -> p.open(managementService, threadFactory)).collect(Collectors.toList());
return CompletableFuture.allOf(futures.toArray(new CompletableFuture[futures.size()])).thenApply(v -> {
LOGGER.info("Started");
return this;
});
}
Aggregations