public static Reader createReader(FileSystem fs, Path path, CacheConfig cacheConf,
    boolean primaryReplicaReader, Configuration conf) throws IOException {
    Preconditions.checkNotNull(cacheConf, "Cannot create Reader with null CacheConf");
    FSDataInputStreamWrapper stream = new FSDataInputStreamWrapper(fs, path);
    ReaderContext context =
      new ReaderContextBuilder().withFilePath(path).withInputStreamWrapper(stream)
        .withFileSize(fs.getFileStatus(path).getLen()).withFileSystem(stream.getHfs())
        .withPrimaryReplicaReader(primaryReplicaReader).withReaderType(ReaderType.PREAD).build();
    HFileInfo fileInfo = new HFileInfo(context, conf);
    Reader reader = createReader(context, fileInfo, cacheConf, conf);
    fileInfo.initMetaAndIndex(reader);
    return reader;
  }
@param fs                   filesystem
@param path                 Path to file to read
@param cacheConf            This must not be null.
@param primaryReplicaReader true if this is a reader for primary replica
@param conf                 Configuration
@return an active Reader instance
@throws IOException Will throw a CorruptHFileException (DoNotRetryIOException subtype) if hfile
                    is corrupt/invalid.
@see CacheConfig#CacheConfig(Configuration)
hbase-server/src/main/java/org/apache/hadoop/hbase/io/hfile/HFile.java