@Override
  public CompletableFuture<Long> sync(boolean forceSync) {
    CompletableFuture<Long> future = new CompletableFuture<>();
    AtomicInteger remaining = new AtomicInteger(writers.size());
    writers.forEach(w -> addListener(w.sync(forceSync), (length, error) -> {
      if (error != null) {
        future.completeExceptionally(error);
        return;
      }
      if (remaining.decrementAndGet() == 0) {
        future.complete(length);
      }
    }));
    return future;
  }
An {@link AsyncWriter} wrapper which writes data to a set of {@link AsyncWriter} instances.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/CombinedAsyncWriter.java