private boolean populateResource(Resource resource, Request request, Predicate predicate)
      throws SystemException {

    Set<String> propertyIds = getPropertyIds();

    if (propertyIds.isEmpty()) {
      return true;
    }

    metricsPaddingMethod = DEFAULT_PADDING_METHOD;

    Set<String> requestPropertyIds = request.getPropertyIds();
    if (requestPropertyIds != null && !requestPropertyIds.isEmpty()) {
      for (String propertyId : requestPropertyIds) {
        if (propertyId.startsWith(ZERO_PADDING_PARAM)) {
          String paddingStrategyStr = propertyId.substring(ZERO_PADDING_PARAM.length() + 1);
          metricsPaddingMethod = new MetricsPaddingMethod(
            MetricsPaddingMethod.PADDING_STRATEGY.valueOf(paddingStrategyStr));
        }
      }
    }

    String clusterName = (String) resource.getPropertyValue(clusterNamePropertyId);

    // Check liveliness of host
    if (!hostProvider.isCollectorHostLive(clusterName, TIMELINE_METRICS)) {
      if (printSkipPopulateMsgHostCounter.getAndIncrement() == 0) {
        LOG.info("METRICS_COLLECTOR host is not live. Skip populating " +
          "resources with metrics, next message will be logged after 1000 " +
          "attempts.");
      } else {
        printSkipPopulateMsgHostCounter.compareAndSet(1000, 0);
      }

      return true;
    }
    // reset
    printSkipPopulateMsgHostCompCounter.set(0);

    // Check liveliness of Collector
    if (!hostProvider.isCollectorComponentLive(clusterName, TIMELINE_METRICS)) {
      if (printSkipPopulateMsgHostCompCounter.getAndIncrement() == 0) {
        LOG.info("METRICS_COLLECTOR is not live. Skip populating resources" +
          " with metrics, next message will be logged after 1000 " +
          "attempts.");
      } else {
        printSkipPopulateMsgHostCompCounter.compareAndSet(1000, 0);
      }

      return true;
    }
    // reset
    printSkipPopulateMsgHostCompCounter.set(0);

    setProperties(resource, clusterName, request, getRequestPropertyIds(request, predicate));

    return true;
  }
Populate a resource by obtaining the requested Ganglia RESOURCE_METRICS.

@param resource  the resource to be populated
@param request   the request
@param predicate the predicate

@return true if the resource was successfully populated with the requested properties

@throws SystemException if unable to populate the resource
ambari-server/src/main/java/org/apache/ambari/server/controller/metrics/timeline/AMSReportPropertyProvider.java