public static int getMetaRSPort(Connection connection) throws IOException {
    try (RegionLocator locator = connection.getRegionLocator(TableName.META_TABLE_NAME)) {
      return locator.getRegionLocation(Bytes.toBytes("")).getPort();
    }
  }
Creates a random table with the given parameters
hbase-server/src/test/java/org/apache/hadoop/hbase/HBaseTestingUtil.java