private Set<String> splitHostNamesInBatches(List<String> hostNames, int batch_size) {
    Set<String> hostNamesBatches = new HashSet<>();
    StringBuilder sb = new StringBuilder();
    for (int i = 0; i < hostNames.size(); i++) {
      if (sb.length() != 0) {
        sb.append(",");
      }
      sb.append(hostNames.get(i));

      if ((i + 1) % batch_size == 0) {
        hostNamesBatches.add(sb.toString());
        sb = new StringBuilder();
      }
    }

    if (hostNamesBatches.size() == 0 || !"".equals(sb.toString())) {
      hostNamesBatches.add(sb.toString());
    }
    return hostNamesBatches;
  }
Populate the associated resources by making a call to the Metrics
service.

@return a collection of populated resources
@throws SystemException if unable to populate the resources
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSPropertyProvider.java