@Override
  public UpgradeCheckResult perform(UpgradeCheckRequest request) throws AmbariException {
    UpgradeCheckResult result = new UpgradeCheckResult(this);

    final Cluster cluster = clustersProvider.get().getCluster(request.getClusterName());
    Set<String> installedServices = cluster.getServices().keySet();

    List<String> noUpgradeSupportServices = getNoUpgradeSupportServices(request);
    Map<String, String> replacedServices = getReplacedServices(request);
    List<String> removedServices = getRemovedServices(request);

    List<String> failReasons = new ArrayList<>();

    String reason = getFailReason(result, request);
    for(String service: noUpgradeSupportServices){
      if (installedServices.contains(service.toUpperCase())){
        result.getFailedOn().add(service);
        String msg = String.format(reason, service, service);
        failReasons.add(msg);
      }
    }

    reason = getFailReason(KEY_SERVICE_REPLACED, result, request);
    for (Map.Entry<String, String> entry : replacedServices.entrySet()) {
      String removedService = entry.getKey();
      if(installedServices.contains(removedService.toUpperCase())){
        result.getFailedOn().add(removedService);
        String newService = entry.getValue();
        String msg = String.format(reason, removedService, newService);
        failReasons.add(msg);
      }
    }

    reason = getFailReason(KEY_SERVICE_REMOVED, result, request);
    for(String service: removedServices){
      if (installedServices.contains(service.toUpperCase())){
        result.getFailedOn().add(service);
        String msg = String.format(reason, service, service);
        failReasons.add(msg);
      }
    }

    if(!failReasons.isEmpty()){
      result.setStatus(UpgradeCheckStatus.FAIL);
      result.setFailReason(StringUtils.join(failReasons, '\n'));
    }

    return result;
  }
Checks if Atlas service is present. Upgrade to stack HDP 2.5 can't pursuit
with existed on the cluster Atlas service.
ambari-server/src/main/java/org/apache/ambari/server/checks/ServicePresenceCheck.java