@Override
  public Set<ExtensionVersionResponse> getExtensionVersions(
      Set<ExtensionVersionRequest> requests) throws AmbariException {
    Set<ExtensionVersionResponse> response = new HashSet<>();
    for (ExtensionVersionRequest request : requests) {
      String extensionName = request.getExtensionName();
      try {
        Set<ExtensionVersionResponse> stackVersions = getExtensionVersions(request);
        for (ExtensionVersionResponse stackVersionResponse : stackVersions) {
          stackVersionResponse.setExtensionName(extensionName);
        }
        response.addAll(stackVersions);
      } catch (StackAccessException e) {
        if (requests.size() == 1) {
          // only throw exception if 1 request.
          // there will be > 1 request in case of OR predicate
          throw e;
        }
      }
    }

    return response;
  }
Chooses a healthy host from the list of candidate hosts randomly. If there
are no healthy hosts, then this method will return {@code null}.
<p/>
The host's {@link HostState} is used to determine if a host is healthy.

@return a random healthy host, or {@code null}.
@throws AmbariException
@see {@link HostState#HEALTHY}
ambari-server/src/main/java/org/apache/ambari/server/controller/AmbariManagementControllerImpl.java