public static byte[] getRegionNameForDisplay(RegionInfo ri, Configuration conf) {
    boolean displayKey = conf.getBoolean(DISPLAY_KEYS_KEY, true);
    if (displayKey || ri.getTable().equals(TableName.META_TABLE_NAME)) {
      return ri.getRegionName();
    } else {
      // create a modified regionname with the startkey replaced but preserving
      // the other parts including the encodedname.
      try {
        byte[][] regionNameParts = RegionInfo.parseRegionName(ri.getRegionName());
        regionNameParts[1] = HIDDEN_START_KEY; // replace the real startkey
        int len = 0;
        // get the total length
        for (byte[] b : regionNameParts) {
          len += b.length;
        }
        byte[] encodedRegionName = Bytes.toBytes(RegionInfo.encodeRegionName(ri.getRegionName()));
        len += encodedRegionName.length;
        // allocate some extra bytes for the delimiters and the last '.'
        byte[] modifiedName = new byte[len + regionNameParts.length + 1];
        int lengthSoFar = 0;
        int loopCount = 0;
        for (byte[] b : regionNameParts) {
          System.arraycopy(b, 0, modifiedName, lengthSoFar, b.length);
          lengthSoFar += b.length;
          if (loopCount++ == 2) modifiedName[lengthSoFar++] = RegionInfo.REPLICA_ID_DELIMITER;
          else modifiedName[lengthSoFar++] = HConstants.DELIMITER;
        }
        // replace the last comma with '.'
        modifiedName[lengthSoFar - 1] = RegionInfo.ENC_SEPARATOR;
        System.arraycopy(encodedRegionName, 0, modifiedName, lengthSoFar, encodedRegionName.length);
        lengthSoFar += encodedRegionName.length;
        modifiedName[lengthSoFar] = RegionInfo.ENC_SEPARATOR;
        return modifiedName;
      } catch (IOException e) {
        // LOG.warn("Encountered exception " + e);
        throw new RuntimeException(e);
      }
    }
  }
Get the region name for display. Optionally hide the start key.
@return region name bytes
hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionInfoDisplay.java