private void closeDataNodeChannelsAndAwait() {
    List<ChannelFuture> futures = new ArrayList<>();
    for (Channel ch : datanodeInfoMap.keySet()) {
      futures.add(ch.close());
    }
    for (ChannelFuture future : futures) {
      consume(future.awaitUninterruptibly());
    }
  }
Flush the buffer out to datanodes.
@param syncBlock will call hsync if true, otherwise hflush.
@return A CompletableFuture that hold the acked length after flushing.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutput.java