@Override
  @Transactional
  public void setUpgradeState(UpgradeState upgradeState) {
    HostComponentStateEntity stateEntity = getStateEntity();
    if (stateEntity != null) {
      stateEntity.setUpgradeState(upgradeState);
      stateEntity = hostComponentStateDAO.merge(stateEntity);
    } else {
      LOG.warn("Setting a member on an entity object that may have been "
          + "previously deleted, serviceName = " + getServiceName() + ", " + "componentName = "
          + getServiceComponentName() + ", " + "hostName = " + getHostName());
    }
  }
To be called during the upgrade of a specific Component in a host.
The potential upgrade states are NONE (default), PENDING, IN_PROGRESS, FAILED.
If the upgrade completes successfully, the upgradeState should be set back to NONE.
If the upgrade fails, then the user can retry to set it back into PENDING or IN_PROGRESS.
If the upgrade is aborted, then the upgradeState should be set back to NONE.

@param upgradeState  the upgrade state
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java