private void validateServiceComponentHost(ServiceComponent serviceComponent,
                                            ServiceComponentHost serviceComponentHost,
                                            UpgradeCheckResult result,
                                            List<String> errorMessages) {
    if (serviceComponentHost.getUpgradeState().equals(UpgradeState.VERSION_MISMATCH)) {
      String hostName = serviceComponentHost.getHostName();
      String serviceComponentName = serviceComponentHost.getServiceComponentName();
      String desiredVersion = serviceComponent.getDesiredVersion();
      String actualVersion = serviceComponentHost.getVersion();

      String message = hostName + "/" + serviceComponentName
          + " desired version: " + desiredVersion
          + ", actual version: " + actualVersion;
      result.getFailedOn().add(hostName);
      errorMessages.add(message);
    }
  }
Validates host component. If upgrade state of host component is VERSION_MISMATCH,
adds hostname to a Failed On map of prerequisite check, and adds all other
host component version details to errorMessages
@param serviceComponent
@param serviceComponentHost
@param result
@param errorMessages
ambari-server/src/main/java/org/apache/ambari/server/checks/VersionMismatchCheck.java