public Set<String> getRackSensitiveServicesNames(String stackName, String version)
      throws AmbariException {

    HashSet<String> needRestartServices = new HashSet<>();

    Collection<ServiceInfo> serviceInfos = getServices(stackName, version).values();

    for (ServiceInfo service : serviceInfos) {

      Boolean restartRequiredAfterRackChange = service.isRestartRequiredAfterRackChange();

      if (restartRequiredAfterRackChange != null && restartRequiredAfterRackChange) {
        needRestartServices.add(service.getName());
      }
    }
    return needRestartServices;
  }
Get the set of names of services which require restart when host rack information is changed.

@param stackName  the stack name
@param version    the stack version

@return the set of services which require restart when host rack information is changed

@throws AmbariException if the service set can not be acquired
ambari-server/src/main/java/org/apache/ambari/server/api/services/AmbariMetaInfo.java