@Test public void testPutRegionInfoFromHdfsInMeta() throws Exception { RegionInfo info = this.createRegionInfo("test-tbl"); Path regionPath = new Path("/hbase/data/default/test-tbl/" + info.getEncodedName()); FSDataInputStream fis = new FSDataInputStream(new TestInputStreamSeekable(info)); when(this.mockedFileSystem.open(new Path(regionPath, ".regioninfo"))) .thenReturn(fis); fixer.putRegionInfoFromHdfsInMeta(regionPath); Mockito.verify(this.mockedConnection).getTable(TableName.META_TABLE_NAME); ArgumentCaptor<Put> captor = ArgumentCaptor.forClass(Put.class); Mockito.verify(this.mockedTable).put(captor.capture()); Put capturedPut = captor.getValue(); List<Cell> cells = capturedPut.get(HConstants.CATALOG_FAMILY, HConstants.STATE_QUALIFIER); assertEquals(1, cells.size()); String state = Bytes.toString(cells.get(0).getValueArray(), cells.get(0).getValueOffset(), cells.get(0).getValueLength()); assertEquals(RegionState.State.valueOf(state), RegionState.State.CLOSED); cells = capturedPut.get(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); byte[] returnedInfo = Bytes.copy(cells.get(0).getValueArray(), cells.get(0).getValueOffset(), cells.get(0).getValueLength()); assertEquals(info, RegionInfo.parseFrom(returnedInfo)); }
void putRegionInfoFromHdfsInMeta(Path region) throws IOException { RegionInfo info = HRegionFileSystem.loadRegionInfoFileContent(fs, region); HBCKMetaTableAccessor.addRegionToMeta(conn, info); }
FsRegionsMetaRecoverer implements Closeable { void putRegionInfoFromHdfsInMeta(Path region) throws IOException { RegionInfo info = HRegionFileSystem.loadRegionInfoFileContent(fs, region); HBCKMetaTableAccessor.addRegionToMeta(conn, info); } }
FsRegionsMetaRecoverer implements Closeable { void putRegionInfoFromHdfsInMeta(Path region) throws IOException { RegionInfo info = HRegionFileSystem.loadRegionInfoFileContent(fs, region); HBCKMetaTableAccessor.addRegionToMeta(conn, info); } FsRegionsMetaRecoverer(Configuration configuration);   FsRegionsMetaRecoverer(Configuration configuration, Connection connection, FileSystem fileSystem); }
FsRegionsMetaRecoverer implements Closeable { void putRegionInfoFromHdfsInMeta(Path region) throws IOException { RegionInfo info = HRegionFileSystem.loadRegionInfoFileContent(fs, region); HBCKMetaTableAccessor.addRegionToMeta(conn, info); } FsRegionsMetaRecoverer(Configuration configuration);   FsRegionsMetaRecoverer(Configuration configuration, Connection connection, FileSystem fileSystem); Map<TableName,List<Path>> reportTablesMissingRegions(final List<String> namespacesOrTables); Map<TableName,List<RegionInfo>> reportTablesExtraRegions(final List<String> namespacesOrTables); List<Future<List<String>>> addMissingRegionsInMetaForTables(
      List<String> nameSpaceOrTable); List<Future<List<String>>> removeExtraRegionsFromMetaForTables(
    List<String> nameSpaceOrTable); @Override void close(); }
FsRegionsMetaRecoverer implements Closeable { void putRegionInfoFromHdfsInMeta(Path region) throws IOException { RegionInfo info = HRegionFileSystem.loadRegionInfoFileContent(fs, region); HBCKMetaTableAccessor.addRegionToMeta(conn, info); } FsRegionsMetaRecoverer(Configuration configuration);   FsRegionsMetaRecoverer(Configuration configuration, Connection connection, FileSystem fileSystem); Map<TableName,List<Path>> reportTablesMissingRegions(final List<String> namespacesOrTables); Map<TableName,List<RegionInfo>> reportTablesExtraRegions(final List<String> namespacesOrTables); List<Future<List<String>>> addMissingRegionsInMetaForTables(
      List<String> nameSpaceOrTable); List<Future<List<String>>> removeExtraRegionsFromMetaForTables(
    List<String> nameSpaceOrTable); @Override void close();  }