private DirectIOExecutor createDirectIOExecutor(int bufferSize) {
    if (bufferSize == 0) {
      return new DirectIOOneTimeExecutor();
    }
    return new DirectIOBufferedExecutor(bufferSize);
  }
Creates a LogSegment abstraction with the given file and given file channel (for testing purpose currently)
@param file the backing {@link File} for this segment.
@param capacityInBytes the intended capacity of the segment
@param config the store config to use in this log segment
@param metrics the {@link StoreMetrics} instance to use.
@param fileChannel the {@link FileChannel} associated with this segment.
@throws StoreException
ambry-store/src/main/java/com/github/ambry/store/LogSegment.java