Examples of Aggregator


Examples of com.salesforce.phoenix.expression.aggregator.Aggregator

    public Aggregator newClientAggregator() {
        return newServerAggregator(null);
    }

    public Aggregator newServerAggregator(Configuration config, ImmutableBytesWritable ptr) {
        Aggregator agg = newServerAggregator(config);
        agg.aggregate(null, ptr);
        return agg;
    }
View Full Code Here

Examples of net.opentsdb.core.Aggregator

      int i = parts.length;
      if (i < 2 || i > 4) {
        throw new BadRequestException("Invalid parameter m=" + m + " ("
          + (i < 2 ? "not enough" : "too many") + " :-separated parts)");
      }
      final Aggregator agg = getAggregator(parts[0]);
      i--;  // Move to the last part (the metric name).
      final HashMap<String, String> parsedtags = new HashMap<String, String>();
      final String metric = Tags.parseWithMetric(parts[i], parsedtags);
      final boolean rate = parts[--i].startsWith("rate");
      final RateOptions rate_options = QueryRpc.parseRateOptions(rate, parts[i]);
      if (rate) {
        i--;  // Move to the next part.
      }
      final Query tsdbquery = tsdb.newQuery();
      try {
        tsdbquery.setTimeSeries(metric, parsedtags, agg, rate, rate_options);
      } catch (NoSuchUniqueName e) {
        throw new BadRequestException(e.getMessage());
      }
      // downsampling function & interval.
      if (i > 0) {
        final int dash = parts[1].indexOf('-', 1)// 1st char can't be `-'.
        if (dash < 0) {
          throw new BadRequestException("Invalid downsampling specifier '"
                                        + parts[1] + "' in m=" + m);
        }
        Aggregator downsampler;
        try {
          downsampler = Aggregators.get(parts[1].substring(dash + 1));
        } catch (NoSuchElementException e) {
          throw new BadRequestException("No such downsampling function: "
                                        + parts[1].substring(dash + 1));
View Full Code Here

Examples of net.opentsdb.core.Aggregator

      }
      i++;
    }

    while (i < args.length) {
      final Aggregator agg = Aggregators.get(args[i++]);
      final boolean rate = args[i].equals("rate");
      RateOptions rate_options = new RateOptions(false, Long.MAX_VALUE,
          RateOptions.DEFAULT_RESET_VALUE);
      if (rate) {
        i++;
       
        long counterMax = Long.MAX_VALUE;
        long resetValue = RateOptions.DEFAULT_RESET_VALUE;
        if (args[i].startsWith("counter")) {
          String[] parts = Tags.splitString(args[i], ',');
          if (parts.length >= 2 && parts[1].length() > 0) {
            counterMax = Long.parseLong(parts[1]);
          }
          if (parts.length >= 3 && parts[2].length() > 0) {
            resetValue = Long.parseLong(parts[2]);
          }
          rate_options = new RateOptions(true, counterMax, resetValue);
          i++;
        }
      }
      final boolean downsample = args[i].equals("downsample");
      if (downsample) {
        i++;
      }
      final long interval = downsample ? Long.parseLong(args[i++]) : 0;
      final Aggregator sampler = downsample ? Aggregators.get(args[i++]) : null;
      final String metric = args[i++];
      final HashMap<String, String> tags = new HashMap<String, String>();
      while (i < args.length && args[i].indexOf(' ', 1) < 0
             && args[i].indexOf('=', 1) > 0) {
        Tags.parse(tags, args[i++]);
View Full Code Here

Examples of org.apache.accumulo.core.iterators.aggregation.Aggregator

  }
 
  private void findTop() throws IOException {
    // check if aggregation is needed
    if (iterator.hasTop()) {
      Aggregator aggr = aggregators.getObject(iterator.getTopKey());
      if (aggr != null) {
        aggregateRowColumn(aggr);
      }
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.iterators.aggregation.Aggregator

  }
 
  private void findTop() throws IOException {
    // check if aggregation is needed
    if (iterator.hasTop()) {
      Aggregator aggr = aggregators.getObject(iterator.getTopKey());
      if (aggr != null) {
        aggregateRowColumn(aggr);
      }
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.iterators.aggregation.Aggregator

  }
 
  private void findTop() throws IOException {
    // check if aggregation is needed
    if (iterator.hasTop()) {
      Aggregator aggr = aggregators.getObject(iterator.getTopKey());
      if (aggr != null) {
        aggregateRowColumn(aggr);
      }
    }
  }
View Full Code Here

Examples of org.apache.accumulo.core.iterators.aggregation.Aggregator

  }
 
  private void findTop() throws IOException {
    // check if aggregation is needed
    if (iterator.hasTop()) {
      Aggregator aggr = aggregators.getObject(iterator.getTopKey());
      if (aggr != null) {
        aggregateRowColumn(aggr);
      }
    }
  }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    @Override
    public void addRoutes(RouteContext routeContext, Collection<Route> routes) throws Exception {
        Endpoint from = routeContext.getEndpoint();
        final Processor processor = routeContext.createProcessor(this);
        final Aggregator service = new Aggregator(from, processor, getExpression()
            .createExpression(routeContext), aggregationStrategy);

        Route route = new Route<Exchange>(from, service) {
            @Override
            public String toString() {
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }

    @SuppressWarnings("unchecked")
    @Override
    public void addRoutes(RouteContext routeContext, Collection<Route> routes) throws Exception {
        final Aggregator aggregator = createAggregator(routeContext);
        doAddRoute(routeContext, routes, aggregator);
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

        routes.add(route);
    }
    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        final Aggregator aggregator = createAggregator(routeContext);
       
        doAddRoute(routeContext, routeContext.getCamelContext().getRoutes(), aggregator);
        routeContext.setIsRouteAdded(true);
        return aggregator;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.