static void completeFile(FanOutOneBlockAsyncDFSOutput output, DFSClient client,
    ClientProtocol namenode, String src, String clientName, ExtendedBlock block,
    HdfsFileStatus stat) throws IOException {
    int maxRetries = client.getConf().getNumBlockWriteLocateFollowingRetry();
    for (int retry = 0; retry < maxRetries; retry++) {
      try {
        if (namenode.complete(src, clientName, block, stat.getFileId())) {
          endFileLease(output);
          return;
        } else {
          LOG.warn("complete file " + src + " not finished, retry = " + retry);
        }
      } catch (RemoteException e) {
        throw e.unwrapRemoteException();
      }
      sleepIgnoreInterrupt(retry);
    }
    throw new IOException("can not complete file after retrying " + maxRetries + " times");
  }
Create a {@link FanOutOneBlockAsyncDFSOutput}. The method maybe blocked so do not call it
inside an {@link EventLoop}.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/FanOutOneBlockAsyncDFSOutputHelper.java