public ServiceInfo getPropertyOwnerService(Cluster cluster, String configType, String propertyName) throws AmbariException {

    for (Service service : cluster.getServices().values()) {
      StackId stackId = service.getDesiredStackId();
      StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion());

      for (ServiceInfo serviceInfo : stack.getServices()) {
        Set<PropertyInfo> serviceProperties = ambariMetaInfo.getServiceProperties(stack.getName(), stack.getVersion(), serviceInfo.getName());

        for (PropertyInfo stackProperty : serviceProperties) {
          String stackPropertyConfigType = fileNameToConfigType(stackProperty.getFilename());

          if (stackProperty.getName().equals(propertyName) && stackPropertyConfigType.equals(configType)) {
            return serviceInfo;
          }
        }
      }
    }

    return null;
  }
Gets the configuration value referenced by the specified placeholder from
the cluster configuration. This will take a configuration placeholder such
as {{hdfs-site/foo}} and return the value of {@code foo} defined in
{@code hdfs-site}.

@param cluster     the cluster to use when rendering the placeholder value (not
                   {@code null}).
@param placeholder the placeholder value, such as {{hdfs-site/foobar}} (not
                   {@code null} )
@return the configuration value, or {@code null} if none.
@throws AmbariException if there was a problem parsing the placeholder or retrieving the
                        referenced value.
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java