private String getTimelineAppId(String componentName) {
      if (timelineAppIdCache.containsKey(componentName)) {
        return timelineAppIdCache.get(componentName);
      } else {
        StackId stackId;
        try {
          AmbariManagementController managementController = AmbariServer.getController();
          Cluster cluster = managementController.getClusters().getCluster(clusterName);
          Service service = cluster.getServiceByComponentName(componentName);
          stackId = service.getDesiredStackId();

          if (stackId != null) {
            String stackName = stackId.getStackName();
            String version = stackId.getStackVersion();
            AmbariMetaInfo ambariMetaInfo = managementController.getAmbariMetaInfo();
            String serviceName = service.getName();
            String timeLineAppId = ambariMetaInfo.getComponent(stackName, version, serviceName, componentName).getTimelineAppid();
            if (timeLineAppId != null){
              timelineAppIdCache.put(componentName, timeLineAppId);
              return timeLineAppId;
            }
          }
        } catch (Exception e) {
          e.printStackTrace();
        }
      }

      return componentName;
    }
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