private void processUpgradePacks() throws AmbariException {
    if (stackInfo.getUpgradePacks() == null) {
      return;
    }

    for (UpgradePack pack : stackInfo.getUpgradePacks().values()) {
      List<UpgradePack> servicePacks = new ArrayList<>();
      for (ServiceModule module : serviceModules.values()) {
        File upgradesFolder = module.getModuleInfo().getServiceUpgradesFolder();
        if (upgradesFolder != null) {
          UpgradePack servicePack = getServiceUpgradePack(pack, upgradesFolder);
          if (servicePack != null) {
            servicePacks.add(servicePack);
          }
        }
      }
      if (servicePacks.size() > 0) {
        LOG.info("Merging service specific upgrades for pack: " + pack.getName());
        mergeUpgradePack(pack, servicePacks);
      }
    }

    ConfigUpgradePack configPack = stackInfo.getConfigUpgradePack();
    if (configPack == null) {
      return;
    }

    for (ServiceModule module : serviceModules.values()) {
      File upgradesFolder = module.getModuleInfo().getServiceUpgradesFolder();
      if (upgradesFolder != null) {
        mergeConfigUpgradePack(configPack, upgradesFolder);
      }
    }
  }
Process upgrade packs associated with the stack.
@throws AmbariException if unable to fully process the upgrade packs
ambari-server/src/main/java/org/apache/ambari/server/stack/StackModule.java