public boolean createConfigTypes(Cluster cluster, StackId stackId,
      AmbariManagementController controller, Map<String, Map<String, String>> batchProperties,
      String authenticatedUserName, String serviceVersionNote) throws AmbariException {

    Map<String, Set<Config>> serviceMapped = new HashMap<>();

    for (Map.Entry<String, Map<String, String>> entry : batchProperties.entrySet()) {
      String type = entry.getKey();
      Map<String, String> properties = entry.getValue();

      Config baseConfig = createConfig(cluster, stackId, controller, type, FIRST_VERSION_TAG,
          properties, Collections.emptyMap());

      if (null != baseConfig) {
        try {
          String service = cluster.getServiceByConfigType(type);
          if (!serviceMapped.containsKey(service)) {
            serviceMapped.put(service, new HashSet<>());
          }
          serviceMapped.get(service).add(baseConfig);
        } catch (Exception e) {
          // !!! ignore
        }
      }
    }

    // create the configuration history entries
    boolean added = false;
    for (Set<Config> configs : serviceMapped.values()) {
      if (!configs.isEmpty()) {
        cluster.addDesiredConfig(authenticatedUserName, configs, serviceVersionNote);
        added = true;
      }
    }
    return added;
  }
Create configurations and assign them for services.
@param cluster               the cluster
@param controller            the controller
@param stackId               the stack to create the new properties for
@param batchProperties       the type->config map batch of properties
@param authenticatedUserName the user that initiated the change
@param serviceVersionNote    the service version note
@return true if configs were created
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java