Examples of Aggregator


Examples of org.apache.camel.processor.Aggregator

    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        Endpoint from = routeContext.getEndpoint();
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(from, processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            Expression aggregateExpression = getExpression().createExpression(routeContext);

            Predicate predicate = null;
            if (getCompletedPredicate() != null) {
                predicate = getCompletedPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(from, processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(from, processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
       
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }

        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
       
        return aggregator;
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }

    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            Expression aggregateExpression = getExpression().createExpression(routeContext);

            Predicate predicate = null;
            if (getCompletedPredicate() != null) {
                predicate = getCompletedPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
       
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }

        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
       
        return aggregator;
    }
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;
        if (aggregationCollection != null) {
            service = new Aggregator(from, processor, aggregationCollection);
        } else {
            AggregationStrategy strategy = getAggregationStrategy();
            if (strategy == null && strategyRef != null) {
                strategy = routeContext.lookup(strategyRef, AggregationStrategy.class);
            }
            if (strategy == null) {
                strategy = new UseLatestAggregationStrategy();
            }
            Expression aggregateExpression = getExpression().createExpression(routeContext);

            Predicate predicate = null;
            if (completedPredicate != null) {
                predicate = completedPredicate.createPredicate(routeContext);
            }
            if (predicate != null) {
                service = new Aggregator(from, processor, aggregateExpression, strategy, predicate);
            } else {
                service = new Aggregator(from, processor, aggregateExpression, strategy);
            }
        }

        if (batchSize != null) {
            service.setBatchSize(batchSize);
        }
        if (batchTimeout != null) {
            service.setBatchTimeout(batchTimeout);
        }

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

Examples of org.apache.camel.processor.Aggregator

    }
   
    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            if (getExpression() == null) {
                throw new IllegalArgumentException("You need to specify an expression or "
                                                   + "aggregation collection for this aggregator: " + this);
            }
           
            Expression aggregateExpression = getExpression().createExpression(routeContext);          

            Predicate predicate = null;
            if (getCompletionPredicate() != null) {
                predicate = getCompletionPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }
        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
        if (groupExchanges != null) {
            aggregator.setGroupExchanges(groupExchanges);
        }
        if (batchSizeFromConsumer != null) {
            aggregator.setBatchConsumer(batchSizeFromConsumer);
        }

        return aggregator;
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }
   
    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            if (getExpression() == null) {
                throw new IllegalArgumentException("You need to specify an expression or "
                                                   + "aggregation collection for this aggregator: " + this);
            }
           
            Expression aggregateExpression = getExpression().createExpression(routeContext);          

            Predicate predicate = null;
            if (getCompletionPredicate() != null) {
                predicate = getCompletionPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }
        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
        if (groupExchanges != null) {
            aggregator.setGroupExchanges(groupExchanges);
        }
        if (batchSizeFromConsumer != null) {
            aggregator.setBatchConsumer(batchSizeFromConsumer);
        }

        return aggregator;
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }
   
    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            if (getExpression() == null) {
                throw new IllegalArgumentException("You need to specify an expression or "
                                                   + "aggregation collection for this aggregator: " + this);
            }
           
            Expression aggregateExpression = getExpression().createExpression(routeContext);          

            Predicate predicate = null;
            if (getCompletionPredicate() != null) {
                predicate = getCompletionPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }
        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
        if (groupExchanges != null) {
            aggregator.setGroupExchanges(groupExchanges);
        }
        if (batchSizeFromConsumer != null) {
            aggregator.setBatchConsumer(batchSizeFromConsumer);
        }

        return aggregator;
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }
   
    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            if (getExpression() == null) {
                throw new IllegalArgumentException("You need to specify an expression or "
                                                   + "aggregation collection for this aggregator: " + this);
            }
           
            Expression aggregateExpression = getExpression().createExpression(routeContext);          

            Predicate predicate = null;
            if (getCompletionPredicate() != null) {
                predicate = getCompletionPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }
        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }
        if (groupExchanges != null) {
            aggregator.setGroupExchanges(groupExchanges);
        }
        if (batchSizeFromConsumer != null) {
            aggregator.setBatchConsumer(batchSizeFromConsumer);
        }

        return aggregator;
    }
View Full Code Here

Examples of org.apache.camel.processor.Aggregator

    }
   
    protected Aggregator createAggregator(RouteContext routeContext) throws Exception {
        final Processor processor = routeContext.createProcessor(this);

        final Aggregator aggregator;
        if (getAggregationCollection() == null) {
            setAggregationCollection(createAggregationCollection(routeContext));
        }
       
        if (aggregationCollection != null) {
            // create the aggregator using the collection
            // pre configure the collection if its expression and strategy is not set, then
            // use the ones that is pre configured with this type
            if (aggregationCollection.getCorrelationExpression() == null) {
                aggregationCollection.setCorrelationExpression(getExpression());
            }
            if (aggregationCollection.getAggregationStrategy() == null) {
                AggregationStrategy strategy = createAggregationStrategy(routeContext);
                aggregationCollection.setAggregationStrategy(strategy);
            }
            aggregator = new Aggregator(processor, aggregationCollection);
        } else {
            // create the aggregator using a default collection
            AggregationStrategy strategy = createAggregationStrategy(routeContext);

            if (getExpression() == null) {
                throw new IllegalArgumentException("You need to specify an expression or "
                                                   + "aggregation collection for this aggregator: " + this);
            }
           
            Expression aggregateExpression = getExpression().createExpression(routeContext);          

            Predicate predicate = null;
            if (getCompletionPredicate() != null) {
                predicate = getCompletionPredicate().createPredicate(routeContext);
            }
            if (predicate != null) {
                aggregator = new Aggregator(processor, aggregateExpression, strategy, predicate);
            } else {
                aggregator = new Aggregator(processor, aggregateExpression, strategy);
            }
        }
       
        if (batchSize != null) {
            aggregator.setBatchSize(batchSize);
        }
       
        if (batchTimeout != null) {
            aggregator.setBatchTimeout(batchTimeout);
        }

        if (outBatchSize != null) {
            aggregator.setOutBatchSize(outBatchSize);
        }

        if (groupExchanges != null) {
            aggregator.setGroupExchanges(groupExchanges);
        }
       
        return aggregator;
    }
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);

        if (batchSize != 0) {
            service.setBatchSize(batchSize);
        }
        if (batchSize != 0) {
            service.setBatchTimeout(batchTimeout);
        }

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

Examples of org.apache.hadoop.chukwa.database.Aggregator

      fail("SQL Exception: "+ExceptionUtil.getStackTrace(ex));
    }
  }

  public void testAggregator() {
    Aggregator dba = new Aggregator();
    DatabaseWriter db = new DatabaseWriter(dbSetup.cluster);
    dba.setWriter(db);
    String queries = Aggregator.getContents(new File(System
        .getenv("CHUKWA_CONF_DIR")
        + File.separator + "aggregator.sql"));
    String[] query = queries.split("\n");
    for (int i = 0; i < query.length; i++) {
      if(query[i].indexOf("#")==-1) {
        try {
          dba.process(query[i]);
          assertTrue("Completed query: "+query[i],true);
        } catch(Throwable ex) {
          fail("Exception: "+ExceptionUtil.getStackTrace(ex));
        }
      }
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.