protected void initHostChangesFileMap() throws AmbariException {
    JsonObject hostChangesJsonObject = configuration.getHostChangesJson(hostChangesFile);
    hostChangesFileMap = new HashMap<>();

    for (Map.Entry<String, JsonElement> clusterEntry : hostChangesJsonObject.entrySet()) {
      try {
        Gson gson = new Gson();
        hostChangesFileMap.put(clusterEntry.getKey(), gson.<Map<String, String>>fromJson(clusterEntry.getValue(), Map.class));
      } catch(Exception e) {
        throw new AmbariException("Error occurred during mapping Json to Map structure. Please check json structure in file.", e);
      }
    }

    // put current host names to lower case
    Map<String, Map<String,String>> newHostChangesFileMap = new HashMap<>();
    for (Map.Entry<String, Map<String,String>> clusterHosts : hostChangesFileMap.entrySet()) {
      Map<String,String> newHostPairs = new HashMap<>();
      for (Map.Entry<String, String> hostPair : clusterHosts.getValue().entrySet()) {
        newHostPairs.put(hostPair.getKey().toLowerCase(), hostPair.getValue().toLowerCase());
      }
      newHostChangesFileMap.put(clusterHosts.getKey(), newHostPairs);
    }
    hostChangesFileMap = newHostChangesFileMap;
  }
***************************

        if (clusterEntity != null) {
          Collection<ClusterConfigEntity> clusterConfigEntities = clusterEntity.getClusterConfigEntities();
          boolean configUpdated;

          // going through all cluster configs and update property values
          ConfigFactory configFactory = injector.getInstance(ConfigFactory.class);
          for (ClusterConfigEntity clusterConfigEntity : clusterConfigEntities) {
            Config config = configFactory.createExisting(cluster, clusterConfigEntity);
            configUpdated = false;

            for (Map.Entry<String,String> property : config.getProperties().entrySet()) {
              updatedPropertyValue = replaceHosts(property.getValue(), currentHostNames, hostMapping);

              if (updatedPropertyValue != null) {
                Map<String,String> propertiesWithUpdates = config.getProperties();
                propertiesWithUpdates.put(property.getKey(), updatedPropertyValue);
                config.setProperties(propertiesWithUpdates);
                configUpdated = true;
              }
            }

            if (configUpdated) {
              hostConfigsUpdated = true;
              config.save();
            }
          }
        }
        if (hostConfigsUpdated) {
          AgentConfigsHolder agentConfigsHolder = injector.getInstance(AgentConfigsHolder.class);
          agentConfigsHolder.updateData(cluster.getClusterId(), currentHostNames.stream()
              .map(hm -> cluster.getHost(hm).getHostId()).collect(Collectors.toList()));
        }

        //******************************
      }
    }
  }

  /*
Method replaces current hosts with new hosts in propertyValue
ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java