private boolean isVersionAdvertised(UpgradeContext upgradeContext, ServiceComponentHost sch) {
      RepositoryVersionEntity targetRepositoryVersion = upgradeContext.getTargetRepositoryVersion(
          sch.getServiceName());

      StackId targetStack = targetRepositoryVersion.getStackId();

      try {
        ComponentInfo component = upgradeContext.getAmbariMetaInfo().getComponent(
            targetStack.getStackName(), targetStack.getStackVersion(),
            sch.getServiceName(), sch.getServiceComponentName());

        return component.isVersionAdvertised();
      } catch (AmbariException e) {
       LOG.warn("Could not determine if {}/{}/{} could be upgraded; returning false",
           targetStack, sch.getServiceName(), sch.getServiceComponentName(), e);
       return false;
      }
    }
@param upgradeContext  the context
@param sch             the host component
@return                {@code true} if the host component advertises its version
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/HostOrderGrouping.java