/** * Deletes the specified regions from META. * * @param catalogTracker * @param regionsInfo list of regions to be deleted from META * @throws IOException */ public static void deleteRegions(CatalogTracker catalogTracker, List<HRegionInfo> regionsInfo) throws IOException { List<Delete> deletes = new ArrayList<Delete>(regionsInfo.size()); for (HRegionInfo hri : regionsInfo) { deletes.add(new Delete(hri.getRegionName())); } deleteFromMetaTable(catalogTracker, deletes); LOG.info("Deleted from META, regions: " + regionsInfo); }
/** * Deletes daughters references in offlined split parent. * * @param catalogTracker * @param parent Parent row we're to remove daughter reference from * @throws NotAllMetaRegionsOnlineException * @throws IOException */ public static void deleteDaughtersReferencesInParent( CatalogTracker catalogTracker, final HRegionInfo parent) throws NotAllMetaRegionsOnlineException, IOException { Delete delete = new Delete(parent.getRegionName()); delete.deleteColumns(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER); delete.deleteColumns(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER); deleteFromMetaTable(catalogTracker, delete); LOG.info( "Deleted daughters references, qualifier=" + Bytes.toStringBinary(HConstants.SPLITA_QUALIFIER) + " and qualifier=" + Bytes.toStringBinary(HConstants.SPLITB_QUALIFIER) + ", from parent " + parent.getRegionNameAsString()); }
/** * Deletes the specified region from META. * * @param catalogTracker * @param regionInfo region to be deleted from META * @throws IOException */ public static void deleteRegion(CatalogTracker catalogTracker, HRegionInfo regionInfo) throws IOException { Delete delete = new Delete(regionInfo.getRegionName()); deleteFromMetaTable(catalogTracker, delete); LOG.info("Deleted region " + regionInfo.getRegionNameAsString() + " from META"); }
/** * Delete the passed <code>d</code> from the <code>.META.</code> table. * * @param ct CatalogTracker on whose back we will ride the edit. * @param d Delete to add to .META. * @throws IOException */ static void deleteFromMetaTable(final CatalogTracker ct, final Delete d) throws IOException { List<Delete> dels = new ArrayList<Delete>(1); dels.add(d); deleteFromMetaTable(ct, dels); }