public static List<String> parseDnPatterns(Configuration conf, MetastoreConf.ConfVars var) {
    String patternsString = MetastoreConf.getVar(conf, var);
    List<String> result = new ArrayList<>();
    if (StringUtils.isBlank(patternsString)) {
      String defaultBaseDn =
              MetastoreConf.getVar(conf, MetastoreConf.ConfVars.METASTORE_PLAIN_LDAP_BASEDN);
      String guidAttr =
              MetastoreConf.getVar(conf, MetastoreConf.ConfVars.METASTORE_PLAIN_LDAP_GUIDKEY);
      if (StringUtils.isNotBlank(defaultBaseDn)) {
        result.add(guidAttr + "=%s," + defaultBaseDn);
      }
    } else {
      String[] patterns = patternsString.split(":");
      for (String pattern : patterns) {
        if (pattern.contains(",") && pattern.contains("=")) {
          result.add(pattern);
        } else {
          LOG.warn("Unexpected format for " + var + "..ignoring " + pattern);
        }
      }
    }
    return result;
  }
Reads and parses DN patterns from Hive configuration.
<br>
If no patterns are provided in the configuration, then the base DN will be used.
@param conf Hive configuration
@param var variable to be read
@return a list of DN patterns
@see MetastoreConf.ConfVars#METASTORE_PLAIN_LDAP_BASEDN
@see MetastoreConf.ConfVars#METASTORE_PLAIN_LDAP_GUIDKEY
@see MetastoreConf.ConfVars#METASTORE_PLAIN_LDAP_GROUPDNPATTERN
@see MetastoreConf.ConfVars#METASTORE_PLAIN_LDAP_USERDNPATTERN
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/ldap/LdapUtils.java