public Set<PropertyInfo> getStackProperties(Cluster cluster) throws AmbariException {

    Set<StackId> stackIds = new HashSet<>();
    for (Service service : cluster.getServices().values()) {
      stackIds.add(service.getDesiredStackId());
    }

    Set<PropertyInfo> propertySets = new HashSet<>();

    for (StackId stackId : stackIds) {
      StackInfo stack = ambariMetaInfo.getStack(stackId.getStackName(), stackId.getStackVersion());
      propertySets.addAll(ambariMetaInfo.getStackProperties(stack.getName(), stack.getVersion()));
    }

    return propertySets;
  }
Retrieves a Set of PropertyInfo objects containing the relevant properties for the requested
service.
<p/>
If <code>removeExcluded</code> is <code>true</code>, the service's excluded configuration types
are used to prune off PropertyInfos that should be ignored; else if <code>false</code>, all
PropertyInfos will be returned.

@param stackId        a StackId declaring the relevant stack
@param serviceName    a String containing the requested service's name
@param removeExcluded a boolean value indicating whether to remove properties from excluded
                      configuration types (<code>true</code>) or return the complete set of properties regardless of exclusions (<code>false</code>)
@return a Set of PropertyInfo objects for the requested service
@throws AmbariException if the requested stack or the requested service is not found
ambari-server/src/main/java/org/apache/ambari/server/state/ConfigHelper.java