Ejemplo n.º 1
0
 public static void addDaughter(
     final CatalogTracker catalogTracker, final HRegionInfo regionInfo, final ServerName sn)
     throws NotAllMetaRegionsOnlineException, IOException {
   Put put = new Put(regionInfo.getRegionName());
   addRegionInfo(put, regionInfo);
   if (sn != null) addLocation(put, sn);
   putToMetaTable(catalogTracker, put);
   LOG.info(
       "Added daughter "
           + regionInfo.getRegionNameAsString()
           + (sn == null ? ", serverName=null" : ", serverName=" + sn.toString()));
 }
Ejemplo n.º 2
0
 /**
  * Offline parent in meta. Used when splitting.
  *
  * @param catalogTracker
  * @param parent
  * @param a Split daughter region A
  * @param b Split daughter region B
  * @throws NotAllMetaRegionsOnlineException
  * @throws IOException
  */
 public static void offlineParentInMeta(
     CatalogTracker catalogTracker, HRegionInfo parent, final HRegionInfo a, final HRegionInfo b)
     throws NotAllMetaRegionsOnlineException, IOException {
   HRegionInfo copyOfParent = new HRegionInfo(parent);
   copyOfParent.setOffline(true);
   copyOfParent.setSplit(true);
   Put put = new Put(copyOfParent.getRegionName());
   addRegionInfo(put, copyOfParent);
   put.add(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER, Writables.getBytes(a));
   put.add(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER, Writables.getBytes(b));
   putToMetaTable(catalogTracker, put);
   LOG.info("Offlined parent region " + parent.getRegionNameAsString() + " in META");
 }
Ejemplo n.º 3
0
 /**
  * Adds a META row for the specified new region.
  *
  * @param regionInfo region information
  * @throws IOException if problem connecting or updating meta
  */
 public static void addRegionToMeta(CatalogTracker catalogTracker, HRegionInfo regionInfo)
     throws IOException {
   putToMetaTable(catalogTracker, makePutFromRegionInfo(regionInfo));
   LOG.info("Added region " + regionInfo.getRegionNameAsString() + " to META");
 }