Search in sources :

Example 1 with GroupedAggregator

use of org.apache.storm.trident.operation.impl.GroupedAggregator in project storm by apache.

the class GroupedStream method partitionAggregate.

@Override
public IAggregatableStream partitionAggregate(Fields inputFields, Aggregator agg, Fields functionFields) {
    Aggregator groupedAgg = new GroupedAggregator(agg, _groupFields, inputFields, functionFields.size());
    Fields allInFields = TridentUtils.fieldsUnion(_groupFields, inputFields);
    Fields allOutFields = TridentUtils.fieldsConcat(_groupFields, functionFields);
    Stream s = _stream.partitionAggregate(allInFields, groupedAgg, allOutFields);
    return new GroupedStream(s, _groupFields);
}
Also used : Fields(org.apache.storm.tuple.Fields) GroupedAggregator(org.apache.storm.trident.operation.impl.GroupedAggregator) ReducerAggregator(org.apache.storm.trident.operation.ReducerAggregator) GroupedAggregator(org.apache.storm.trident.operation.impl.GroupedAggregator) Aggregator(org.apache.storm.trident.operation.Aggregator) CombinerAggregator(org.apache.storm.trident.operation.CombinerAggregator) Stream(org.apache.storm.trident.Stream)

Aggregations

Stream (org.apache.storm.trident.Stream)1 Aggregator (org.apache.storm.trident.operation.Aggregator)1 CombinerAggregator (org.apache.storm.trident.operation.CombinerAggregator)1 ReducerAggregator (org.apache.storm.trident.operation.ReducerAggregator)1 GroupedAggregator (org.apache.storm.trident.operation.impl.GroupedAggregator)1 Fields (org.apache.storm.tuple.Fields)1