code: @Override
    public int flush(String path, FuseFileInfo fi) {
      LOG.trace("flush({})", path);
      final long fd = fi.fh.get();
      OpenFileEntry oe = mOpenFiles.getFirstByField(ID_INDEX, fd);
      if (oe == null) {
        LOG.error("Cannot find fd for {} in table", path);
        return -ErrorCodes.EBADFD();
      }
      if (oe.getOut() != null) {
        try {
          oe.getOut().flush();
        } catch (IOException e) {
          LOG.error("Failed to flush {}", path, e);
          return -ErrorCodes.EIO();
        }
      } else {
        LOG.debug("Not flushing: {} was not open for writing", path);
      }
      return 0;
    }
docs: Flushes cached data on Alluxio.
  
  Called on explicit sync() operation or at close().
  
  @param path The path on the FS of the file to close
  @param fi FileInfo data struct kept by FUSE
  @return 0 on success, a negative value on error