@Override
  public void close() throws IOException {
    Preconditions.checkState(buffer.size() == 0, "should call flush first before calling close");
    executor.shutdown();
    out.close();
  }
This flush0 method could only be called by single thread, so here we could safely overwrite
without any synchronization.
hbase-asyncfs/src/main/java/org/apache/hadoop/hbase/io/asyncfs/WrapperAsyncFSOutput.java