/** * Handles a snapshot request from a peer. * * @return a future to be completed once the snapshot is complete */ private CompletableFuture<Void> handleSnapshot() { return Futures.allOf(partitions.values().stream() .map(partition -> partition.snapshot()) .collect(Collectors.toList())) .thenApply(v -> null); }