private Map<String, String[]> getPropertyChanges(Cluster cluster, ConfigurationRequest request) {
    Map<String, String[]>  changedProperties = new HashMap<>();

    // Ensure that the requested property map is not null.
    Map<String, String> requestedProperties  = request.getProperties();
    if (requestedProperties == null) {
      requestedProperties = Collections.emptyMap();
    }

    // Get the current/desired properties for the relevant configuration type and ensure that the
    // property map is not null.
    Config existingConfig = cluster.getDesiredConfigByType(request.getType());
    Map<String, String> existingProperties = (existingConfig == null) ? null : existingConfig.getProperties();
    if (existingProperties == null) {
      existingProperties = Collections.emptyMap();
    }

    // Ensure all propery names are captured, including missing ones from either set.
    Set<String> propertyNames = new HashSet<>();
    propertyNames.addAll(requestedProperties.keySet());
    propertyNames.addAll(existingProperties.keySet());

    for(String propertyName:propertyNames) {
      String requestedValue = requestedProperties.get(propertyName);
      String existingValue = existingProperties.get(propertyName);

      // Perform case-sensitive match.  It is possible that case matters here.
      if((requestedValue == null) ? (existingValue != null) : !requestedValue.equals(existingValue)) {
        changedProperties.put(propertyName, new String[]{existingValue, requestedValue});
      }
    }

    return changedProperties;
  }
Given a configuration request, compares the requested properties to the current set of desired
properties for the same configuration type and returns a map of property names to an array of
Strings representing the current value (index 0), and the requested value (index 1).
<p>
<ul>
<li>
If a property is set in the requested property set and not found in the current property set,
the current value (index 0) will be <code>null</code> - {<code>null</code>, "requested value"}
</li>
<li>
If a property is set in the current property set and not found in the requested property set,
the requested value (index 1) will be <code>null</code> - {"current value", <code>null</code>}
</li>
<li>
If a property found in bother current property set and the requested property set,
the requested value (index 1) will be <code>null</code> - {"current value", "requested value"}
</li>
</ul>

@param cluster the relevant cluster
@param request the request data
@return a map lf property names to String arrays indicating the requsted changes ({current value, requested valiue})
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java