/** * @return A deserialized {@link HRegionInfo} * or null if we failed deserialize or passed bytes null * @see #toByteArray() * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link org.apache.hadoop.hbase.client.RegionInfo#parseFromOrNull(byte[])}. */ @Deprecated public static HRegionInfo parseFromOrNull(final byte [] bytes) { if (bytes == null) return null; return parseFromOrNull(bytes, 0, bytes.length); }
for (Result r; (r = s.next()) != null;) { byte[] b = r.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); HRegionInfo info = HRegionInfo.parseFromOrNull(b); if (info != null && info.getTable().equals(tableName)) {
/** * @return A deserialized {@link HRegionInfo} * or null if we failed deserialize or passed bytes null * @see #toByteArray() * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link org.apache.hadoop.hbase.client.RegionInfo#parseFromOrNull(byte[])}. */ @Deprecated public static HRegionInfo parseFromOrNull(final byte [] bytes) { if (bytes == null) return null; return parseFromOrNull(bytes, 0, bytes.length); }
/** Compare the HRegionInfo we read from HBase to what we stored */ private void validateRegionInfo(byte [] regionBytes) throws IOException { HRegionInfo info = HRegionInfo.parseFromOrNull(regionBytes); assertEquals(REGION_INFO.getRegionId(), info.getRegionId()); assertEquals(0, info.getStartKey().length); assertEquals(0, info.getEndKey().length); assertEquals(0, Bytes.compareTo(info.getRegionName(), REGION_INFO.getRegionName())); //assertEquals(0, info.getTableDesc().compareTo(REGION_INFO.getTableDesc())); }
/** * @return A deserialized {@link HRegionInfo} * or null if we failed deserialize or passed bytes null * @see #toByteArray() */ public static HRegionInfo parseFromOrNull(final byte [] bytes) { if (bytes == null) return null; return parseFromOrNull(bytes, 0, bytes.length); }
/** * @return A deserialized {@link HRegionInfo} * or null if we failed deserialize or passed bytes null * @see #toByteArray() * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0 * Use {@link org.apache.hadoop.hbase.client.RegionInfo#parseFromOrNull(byte[])}. */ @Deprecated public static HRegionInfo parseFromOrNull(final byte [] bytes) { if (bytes == null) return null; return parseFromOrNull(bytes, 0, bytes.length); }
/** * Returns the HRegionInfo object from the column {@link HConstants#CATALOG_FAMILY} and * <code>qualifier</code> of the catalog table result. * @param r a Result object from the catalog table scan * @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. * @deprecated use MetaTableAccessor methods for interacting with meta layouts */ @Deprecated public static HRegionInfo getHRegionInfo(final Result r, byte [] qualifier) { Cell cell = r.getColumnLatestCell( HConstants.CATALOG_FAMILY, qualifier); if (cell == null) return null; return parseFromOrNull(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); }
/** * Returns the HRegionInfo object from the column {@link HConstants#CATALOG_FAMILY} and * <code>qualifier</code> of the catalog table result. * @param r a Result object from the catalog table scan * @param qualifier Column family qualifier * @return An HRegionInfo instance or null. */ private static HRegionInfo getHRegionInfo(final Result r, byte [] qualifier) { Cell cell = r.getColumnLatestCell(getFamily(), qualifier); if (cell == null) return null; return HRegionInfo.parseFromOrNull(cell.getValueArray(), cell.getValueOffset(), cell.getValueLength()); }
for (Result r; (r = s.next()) != null;) { byte[] b = r.getValue(HConstants.CATALOG_FAMILY, HConstants.REGIONINFO_QUALIFIER); HRegionInfo info = HRegionInfo.parseFromOrNull(b); if (info != null && info.getTable().equals(tableName)) {
/** Compare the HRegionInfo we read from HBase to what we stored */ private void validateRegionInfo(byte [] regionBytes) throws IOException { HRegionInfo info = HRegionInfo.parseFromOrNull(regionBytes); assertEquals(REGION_INFO.getRegionId(), info.getRegionId()); assertEquals(0, info.getStartKey().length); assertEquals(0, info.getEndKey().length); assertEquals(0, Bytes.compareTo(info.getRegionName(), REGION_INFO.getRegionName())); //assertEquals(0, info.getTableDesc().compareTo(REGION_INFO.getTableDesc())); }