code: public static List<HostAddress> parse(String spec, HaMode haMode) {
      if (spec == null) {
        throw new IllegalArgumentException("Invalid connection URL, host address must not be empty ");
      }
      if ("".equals(spec)) {
        return new ArrayList<>(0);
      }
      String[] tokens = spec.trim().split(",");
      int size = tokens.length;
      List<HostAddress> arr = new ArrayList<>(size);
  
      // Aurora using cluster end point mustn't have any other host
      if (haMode == HaMode.AURORA) {
        Pattern clusterPattern = Pattern
            .compile("(.+)\\.cluster-([a-z0-9]+\\.[a-z0-9\\-]+\\.rds\\.amazonaws\\.com)",
                Pattern.CASE_INSENSITIVE);
        Matcher matcher = clusterPattern.matcher(spec);
  
        if (!matcher.find()) {
          logger.warn("Aurora recommended connection URL must only use cluster end-point like "
              + "\"jdbc:mariadb:aurora://xx.cluster-yy.zz.rds.amazonaws.com\". "
              + "Using end-point permit auto-discovery of new replicas");
        }
      }
  
      for (String token : tokens) {
        if (token.startsWith("address=")) {
          arr.add(parseParameterHostAddress(token));
        } else {
          arr.add(parseSimpleHostAddress(token));
        }
      }
  
      if (haMode == HaMode.REPLICATION) {
        for (int i = 0; i < size; i++) {
          if (i == 0 && arr.get(i).type == null) {
            arr.get(i).type = ParameterConstant.TYPE_MASTER;
          } else if (i != 0 && arr.get(i).type == null) {
            arr.get(i).type = ParameterConstant.TYPE_SLAVE;
          }
        }
      }
      return arr;
    }
docs: parse - parse server addresses from the URL fragment.
  
  @param spec   list of endpoints in one of the forms 1 - host1,....,hostN:port (missing port
  default to MariaDB default 3306 2 - host:port,...,host:port
  @param haMode High availability mode
  @return parsed endpoints