public static String getRegionEncodedName(final RegionSpecifier regionSpecifier)
    throws DoNotRetryIOException {
    ByteString value = regionSpecifier.getValue();
    RegionSpecifierType type = regionSpecifier.getType();
    switch (type) {
      case REGION_NAME:
        return org.apache.hadoop.hbase.client.RegionInfo.encodeRegionName(value.toByteArray());
      case ENCODED_REGION_NAME:
        return value.toStringUtf8();
      default:
        throw new DoNotRetryIOException("Unsupported region specifier type: " + type);
    }
  }
Find the HRegion encoded name based on a region specifier
@param regionSpecifier the region specifier
@return the corresponding region's encoded name
@throws DoNotRetryIOException if the specifier type is unsupported
hbase-client/src/main/java/org/apache/hadoop/hbase/shaded/protobuf/ProtobufUtil.java