public static HRegion openReadOnlyFileSystemHRegion(final Configuration conf, final FileSystem fs,
    final Path tableDir, RegionInfo info, final TableDescriptor htd) throws IOException {
    Objects.requireNonNull(info, "RegionInfo cannot be null");
    if (LOG.isDebugEnabled()) {
      LOG.debug("Opening region (readOnly filesystem): " + info);
    }
    if (info.getReplicaId() <= 0) {
      info = RegionReplicaUtil.getRegionInfoForReplica(info, 1);
    }
    HRegion r = HRegion.newHRegion(tableDir, null, fs, conf, info, htd, null);
    r.writestate.setReadOnly(true);
    return r.openHRegion(null);
  }
Open a Region on a read-only file-system (like hdfs snapshots)
@param conf The Configuration object to use.
@param fs   Filesystem to use
@param info Info for region to be opened.
@param htd  the table descriptor
@return new HRegion
@throws NullPointerException if {@code info} is {@code null}
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java