@Override
  public Map<String, Map<String, String>> calculateConfigurations(Cluster cluster, String hostname,
                                                                  KerberosDescriptor kerberosDescriptor,
                                                                  KerberosDescriptor userDescriptor,
                                                                  boolean includePreconfigureData,
                                                                  boolean calculateClusterHostInfo,
                                                                  Map<String, String> componentHosts,
                                                                  @Nullable Map<String, DesiredConfig> desiredConfigs)
    throws AmbariException {


    Map<String, Map<String, String>> calculatedConfigurations = addAdditionalConfigurations(
      cluster,
      configHelper.calculateExistingConfigurations(ambariManagementController, cluster, hostname, desiredConfigs),
      hostname,
      (kerberosDescriptor == null) ? null : kerberosDescriptor.getProperties(),
      userDescriptor,
      componentHosts,
      desiredConfigs
    );

    if (includePreconfigureData) {
      calculatedConfigurations = addConfigurationsForPreProcessedServices(
        calculatedConfigurations,
        cluster,
        kerberosDescriptor,
        calculateClusterHostInfo
      );
    }
    return calculatedConfigurations;
  }
Find the {@link ServiceComponentHost}s for the cluster, filtering using the
supplied "should include" command (<code>shouldIncludeCommand</code>).
<p>
If <code>shouldIncludeCommand</code> is <code>null/code>, no filtering will be performed causing
all found {@link ServiceComponentHost}s to be returned.

@param cluster              the cluster
@param shouldIncludeCommand the filtering logic
@return a list of (filtered) {@link ServiceComponentHost}s
@throws AmbariException if an error occurs
ambari-server/src/main/java/org/apache/ambari/server/controller/KerberosHelperImpl.java