@Override
  protected void validate(StackAdvisorRequest request) throws StackAdvisorException {
    if (request.getHosts() == null || request.getHosts().isEmpty()
      || request.getServices() == null || request.getServices().isEmpty()) {
      throw new StackAdvisorException("Hosts and services must not be empty");
    }
  }
{@link StackAdvisorCommand} implementation for component-layout
recommendation.
ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/commands/ComponentLayoutRecommendationCommand.java