public static boolean checkFuture(Procedure<?> proc, Supplier<CompletableFuture<Void>> getFuture,
    Consumer<CompletableFuture<Void>> setFuture, Runnable actionAfterDone) throws IOException {
    CompletableFuture<Void> future = getFuture.get();
    if (future == null) {
      return false;
    }
    // reset future
    setFuture.accept(null);
    FutureUtils.get(future);
    actionAfterDone.run();
    return true;
  }
A helper class for switching procedure out(yielding) while it is doing some time consuming
operation, such as updating meta, where we can get a {@link CompletableFuture} about the
operation.
hbase-server/src/main/java/org/apache/hadoop/hbase/procedure2/ProcedureFutureUtil.java