@Test public void testGetHRegionInfo() throws IOException { assertNull(CatalogJanitor.getHRegionInfo(new Result())); List<KeyValue> kvs = new ArrayList<KeyValue>(); Result r = new Result(kvs); assertNull(CatalogJanitor.getHRegionInfo(r)); byte [] f = HConstants.CATALOG_FAMILY; kvs.add(new KeyValue(HConstants.EMPTY_BYTE_ARRAY, f, HConstants.SERVER_QUALIFIER, f)); r = new Result(kvs); assertNull(CatalogJanitor.getHRegionInfo(r)); kvs.add(new KeyValue(HConstants.EMPTY_BYTE_ARRAY, f, HConstants.REGIONINFO_QUALIFIER, f)); HRegionInfo hri = CatalogJanitor.getHRegionInfo(new Result(kvs)); assertTrue(hri == null); kvs.clear(); kvs.add(new KeyValue(HConstants.EMPTY_BYTE_ARRAY, f, HConstants.REGIONINFO_QUALIFIER, Writables.getBytes(HRegionInfo.FIRST_META_REGIONINFO))); hri = CatalogJanitor.getHRegionInfo(new Result(kvs)); assertNotNull(hri); assertTrue(hri.equals(HRegionInfo.FIRST_META_REGIONINFO)); }
static HRegionInfo getHRegionInfo(final Result result) throws IOException { byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); if (bytes == null) { LOG.warn("REGIONINFO_QUALIFIER is empty in " + result); return null; } return Writables.getHRegionInfo(bytes); }
CatalogJanitor extends Chore { static HRegionInfo getHRegionInfo(final Result result) throws IOException { byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); if (bytes == null) { LOG.warn("REGIONINFO_QUALIFIER is empty in " + result); return null; } return Writables.getHRegionInfo(bytes); } }
CatalogJanitor extends Chore { static HRegionInfo getHRegionInfo(final Result result) throws IOException { byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); if (bytes == null) { LOG.warn("REGIONINFO_QUALIFIER is empty in " + result); return null; } return Writables.getHRegionInfo(bytes); } CatalogJanitor(final Server server, final MasterServices services); }
CatalogJanitor extends Chore { static HRegionInfo getHRegionInfo(final Result result) throws IOException { byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); if (bytes == null) { LOG.warn("REGIONINFO_QUALIFIER is empty in " + result); return null; } return Writables.getHRegionInfo(bytes); } CatalogJanitor(final Server server, final MasterServices services); void setEnabled(final boolean enabled); }
CatalogJanitor extends Chore { static HRegionInfo getHRegionInfo(final Result result) throws IOException { byte [] bytes = result.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); if (bytes == null) { LOG.warn("REGIONINFO_QUALIFIER is empty in " + result); return null; } return Writables.getHRegionInfo(bytes); } CatalogJanitor(final Server server, final MasterServices services); void setEnabled(final boolean enabled);  }