void close(boolean skipDiskFlush) throws IOException {
    if (open.compareAndSet(true, false)) {
      if (!skipDiskFlush) {
        flush();
      }
      try {
        // attempt to close file descriptors even when there is a disk I/O error.
        fileChannel.close();
        directIOExecutor.close();
      } catch (IOException e) {
        if (!skipDiskFlush) {
          throw e;
        }
        logger.warn(
            "I/O exception occurred when closing file channel in log segment. Skipping it to complete store shutdown process");
      }
      dropBufferForAppend();
    }
  }
Closes this log segment
@param skipDiskFlush whether to skip any disk flush operations.
@throws IOException if there is an I/O error while closing the log segment.
ambry-store/src/main/java/com/github/ambry/store/LogSegment.java