use of org.apache.hadoop.hbase.fs.HFileSystem in project hbase by apache.
the class TestHRegionFileSystem method getHRegionFS.
private HRegionFileSystem getHRegionFS(Connection conn, Table table, Configuration conf) throws IOException {
FileSystem fs = TEST_UTIL.getDFSCluster().getFileSystem();
Path tableDir = CommonFSUtils.getTableDir(TEST_UTIL.getDefaultRootDirPath(), table.getName());
List<Path> regionDirs = FSUtils.getRegionDirs(fs, tableDir);
assertEquals(1, regionDirs.size());
List<Path> familyDirs = FSUtils.getFamilyDirs(fs, regionDirs.get(0));
assertEquals(2, familyDirs.size());
RegionInfo hri = conn.getRegionLocator(table.getName()).getAllRegionLocations().get(0).getRegion();
HRegionFileSystem regionFs = new HRegionFileSystem(conf, new HFileSystem(fs), tableDir, hri);
return regionFs;
}
Aggregations