Package org.apache.ambari.server.controller.spi

Examples of org.apache.ambari.server.controller.spi.TemporalInfo


        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here


        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

    Set<String> requestProperties = new HashSet<String>();
    requestProperties.add("metrics/myMetric");

    Map<String, TemporalInfo> temporalInfoMap = new HashMap<String, TemporalInfo>();
    TemporalInfo temporalInfo = new TemporalInfoImpl(1000L, 1100L, 10L);
    temporalInfoMap.put("metrics/myMetric", temporalInfo);

    Request request = PropertyHelper.getReadRequest(requestProperties, temporalInfoMap);
    Predicate predicate = new AlwaysPredicate();
View Full Code Here

      for (Map.Entry<String, PropertyInfo> entry: propertyInfoMap.entrySet()) {
        String       propertyKey  = entry.getKey();
        PropertyInfo propertyInfo = entry.getValue();
        String       propertyId   = propertyInfo.getPropertyId();
        TemporalInfo temporalInfo = request.getTemporalInfo(id);

        if ((propertyInfo.isPointInTime() && temporalInfo == null) ||
            (propertyInfo.isTemporal()    && temporalInfo != null)) {

          long startTime;
          long endTime;

          if (temporalInfo != null) {
            Long endTimeSeconds = temporalInfo.getEndTime();

            endTime   = endTimeSeconds != -1 ? endTimeSeconds * 1000 : Long.MAX_VALUE;
            startTime = temporalInfo.getStartTime() * 1000;
          } else {
            startTime = 0L;
            endTime   = Long.MAX_VALUE;
          }

          String[] parts = propertyId.split("\\.");
          int      size  = parts.length;

          if (size >= 3) {

            metricsDefinitionSet.add(
                    new MetricDefinition(
                            startTime,
                            endTime,
                            parts[size - 3],
                            parts[size - 2],
                            parts[size - 1],
                            componentName.toLowerCase(),
                            hostName,
                            propertyKey,
                            temporalInfo)
            );

          } else {
            if (LOG.isWarnEnabled()) {
              LOG.warn("Can't get metrics for " + id + " : " + propertyId);
            }
          }
        }
      }
    }

    Map<MetricDefinition, List<DataPoint>> results = getMetric(metricsDefinitionSet, statement);

    for(MetricDefinition metricDefinition : metricsDefinitionSet) {
        List<DataPoint> dataPoints = results.containsKey(metricDefinition) ? results.get(metricDefinition) : new ArrayList<DataPoint>();
        TemporalInfo temporalInfo = metricDefinition.getTemporalInfo();
        String propertyKey = metricDefinition.getPropertyKey();
        if (dataPoints != null) {
          if (temporalInfo == null){
            // return the value of the last data point
            int length = dataPoints.size();
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

        }
      }

      mapProperties = new HashMap<String, TemporalInfo>(setMatches.size());
      for (String field : setMatches) {
        TemporalInfo temporalInfo = null;
        if (field.contains("[")) {
          String[] temporalData = field.substring(field.indexOf('[') + 1,
              field.indexOf(']')).split(",");
          field = field.substring(0, field.indexOf('['));
          long start = Long.parseLong(temporalData[0].trim());
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.controller.spi.TemporalInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.