Пример #1
0
 /**
  * Returns the daughter regions by reading from the corresponding columns of the .META. table
  * Result. If the region is not a split parent region, it returns PairOfSameType(null, null).
  */
 public static PairOfSameType<HRegionInfo> getDaughterRegions(Result data) throws IOException {
   HRegionInfo splitA =
       Writables.getHRegionInfoOrNull(
           data.getValue(HConstants.CATALOG_FAMILY, HConstants.SPLITA_QUALIFIER));
   HRegionInfo splitB =
       Writables.getHRegionInfoOrNull(
           data.getValue(HConstants.CATALOG_FAMILY, HConstants.SPLITB_QUALIFIER));
   return new PairOfSameType<HRegionInfo>(splitA, splitB);
 }
Пример #2
0
 /**
  * Parse the content of the cell at {@link HConstants#CATALOG_FAMILY} and <code>qualifier</code>
  * as an HRegionInfo and return it, or null. For use on catalog table {@link Result}.
  *
  * @param r Result instance to pull from.
  * @param qualifier Column family qualifier -- either {@link HConstants#SPLITA_QUALIFIER}, {@link
  *     HConstants#SPLITB_QUALIFIER} or {@link HConstants#REGIONINFO_QUALIFIER}.
  * @return An HRegionInfo instance or null.
  * @throws IOException
  */
 public static HRegionInfo parseHRegionInfoFromCatalogResult(final Result r, byte[] qualifier)
     throws IOException {
   byte[] bytes = r.getValue(HConstants.CATALOG_FAMILY, qualifier);
   if (bytes == null || bytes.length <= 0) return null;
   return Writables.getHRegionInfoOrNull(bytes);
 }