class SnapshotService {

  public void clearSnapshotClusterWide(String snapshotName, String clusterName) throws ReaperException {
    try {
      Cluster cluster = context.storage.getCluster(clusterName);
      List<String> liveNodes = clusterFacade.getLiveNodes(cluster);

      List<Callable<Node>> clearSnapshotTasks = liveNodes
              .stream()
              .map(host -> Node.builder().withCluster(cluster).withHostname(host).build())
              .map(node -> clearSnapshotTask(snapshotName, node))
              .collect(Collectors.toList());

      List<Future<Node>> futures = executor.invokeAll(clearSnapshotTasks);
      for (Future<Node> future : futures) {
        future.get();
      }

      context.storage.deleteSnapshot(Snapshot.builder().withClusterName(clusterName).withName(snapshotName).build());
    } catch (ExecutionException e) {
      LOG.error("Failed clearing {} snapshot for cluster {}", snapshotName, clusterName, e);
    } catch (InterruptedException e) {
      LOG.error("Interrupted clearing {} snapshot for cluster {}", snapshotName, clusterName, e);
      throw new ReaperException(e);
    }
  }

  private  SnapshotService(AppContext context, ExecutorService executor, Supplier<ClusterFacade> clusterFacadeSupplier);

}