private String getSourceData(Map<String, Map<String, String>> replacementsMap, String configurationSpec) {
      String sourceData = null;
      if ((replacementsMap != null) && !replacementsMap.isEmpty() && !StringUtils.isEmpty(configurationSpec)) {
        // Parse the configuration specification to get the config-type and property-name.
        // If only one "part" is found when splitting the String, assume that is it the property name
        // where the config-type will be assumed to be "", which contains properties not set in service
        // configurations
        String[] parts = configurationSpec.split("/");
        String type = null;
        String name = null;

        if (parts.length == 2) {
          type = parts[0];
          name = parts[1];
        } else if (parts.length == 1) {
          name = parts[0];
        }

        if (!StringUtils.isEmpty(name)) {
          Map<String, String> replacements;
          if (type == null) {
            replacements = replacementsMap.get("");
          } else {
            replacements = replacementsMap.get(type);
          }

          if (replacements != null) {
            sourceData = replacements.get(name);
          }
        }
      }

      return sourceData;
    }
Retrieves the source data given a configuration specification and a Map of configurations, grouped by configuration types.
<p>
The configuration specification is expected to be in one of the following forms:
<ul>
<li>config-type/property-name</li>
<li>property-name</li>
</ul>
<p>
The replacementsMap is expected to be a Map of config-types to their name/value pairs.

@param replacementsMap   a Map of data used to perform variable replacements, if needed
@param configurationSpec a configuration specification declaring the config-type (optional) and the relevant
                         property name
@return the found value
ambari-server/src/main/java/org/apache/ambari/server/state/kerberos/VariableReplacementHelper.java