private void setUpgradeStateAndRecalculateHostVersions(ServiceComponentHost sch,
      UpgradeState upgradeState) throws AmbariException {

    if (sch.getUpgradeState() == upgradeState) {
      return;
    }

    // if the upgrade state changes, then also recalculate host versions
    sch.setUpgradeState(upgradeState);
    sch.recalculateHostVersionState();
  }
@param sch
@param upgradeState
@throws AmbariException
ambari-server/src/main/java/org/apache/ambari/server/events/listeners/upgrade/StackVersionListener.java